primitive

package
v0.0.0-...-1a9f8b1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2024 License: Apache-2.0, MIT Imports: 3 Imported by: 59

Documentation

Overview

Package primitive defines marshal.Marshallable implementations for primitive types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllocateInt16

func AllocateInt16(x int16) marshal.Marshallable

AllocateInt16 returns x as a marshallable.

func AllocateInt32

func AllocateInt32(x int32) marshal.Marshallable

AllocateInt32 returns x as a marshallable.

func AllocateInt64

func AllocateInt64(x int64) marshal.Marshallable

AllocateInt64 returns x as a marshallable.

func AllocateInt8

func AllocateInt8(x int8) marshal.Marshallable

AllocateInt8 returns x as a marshallable.

func AllocateUint16

func AllocateUint16(x uint16) marshal.Marshallable

AllocateUint16 returns x as a marshallable.

func AllocateUint32

func AllocateUint32(x uint32) marshal.Marshallable

AllocateUint32 returns x as a marshallable.

func AllocateUint64

func AllocateUint64(x uint64) marshal.Marshallable

AllocateUint64 returns x as a marshallable.

func AllocateUint8

func AllocateUint8(x uint8) marshal.Marshallable

AllocateUint8 returns x as a marshallable.

func AsByteSlice

func AsByteSlice(b []byte) marshal.Marshallable

AsByteSlice returns b as a marshallable. Note that this allocates a new slice header, but does not copy the slice contents.

func CopyByteSliceIn

func CopyByteSliceIn(cc marshal.CopyContext, addr hostarch.Addr, dst *[]byte) (int, error)

CopyByteSliceIn is a convenient wrapper for copying in a []byte from the task's memory.

func CopyByteSliceOut

func CopyByteSliceOut(cc marshal.CopyContext, addr hostarch.Addr, src []byte) (int, error)

CopyByteSliceOut is a convenient wrapper for copying out a []byte to the task's memory.

func CopyInt16In

func CopyInt16In(cc marshal.CopyContext, addr hostarch.Addr, dst *int16) (int, error)

CopyInt16In is a convenient wrapper for copying in an int16 from the task's memory.

func CopyInt16Out

func CopyInt16Out(cc marshal.CopyContext, addr hostarch.Addr, src int16) (int, error)

CopyInt16Out is a convenient wrapper for copying out an int16 to the task's memory.

func CopyInt32In

func CopyInt32In(cc marshal.CopyContext, addr hostarch.Addr, dst *int32) (int, error)

CopyInt32In is a convenient wrapper for copying in an int32 from the task's memory.

func CopyInt32Out

func CopyInt32Out(cc marshal.CopyContext, addr hostarch.Addr, src int32) (int, error)

CopyInt32Out is a convenient wrapper for copying out an int32 to the task's memory.

func CopyInt64In

func CopyInt64In(cc marshal.CopyContext, addr hostarch.Addr, dst *int64) (int, error)

CopyInt64In is a convenient wrapper for copying in an int64 from the task's memory.

func CopyInt64Out

func CopyInt64Out(cc marshal.CopyContext, addr hostarch.Addr, src int64) (int, error)

CopyInt64Out is a convenient wrapper for copying out an int64 to the task's memory.

func CopyInt8In

func CopyInt8In(cc marshal.CopyContext, addr hostarch.Addr, dst *int8) (int, error)

CopyInt8In is a convenient wrapper for copying in an int8 from the task's memory.

func CopyInt8Out

func CopyInt8Out(cc marshal.CopyContext, addr hostarch.Addr, src int8) (int, error)

CopyInt8Out is a convenient wrapper for copying out an int8 to the task's memory.

func CopyStringIn

func CopyStringIn(cc marshal.CopyContext, addr hostarch.Addr, dst *string) (int, error)

CopyStringIn is a convenient wrapper for copying in a string from the task's memory.

func CopyStringOut

func CopyStringOut(cc marshal.CopyContext, addr hostarch.Addr, src string) (int, error)

CopyStringOut is a convenient wrapper for copying out a string to the task's memory.

func CopyUint16In

func CopyUint16In(cc marshal.CopyContext, addr hostarch.Addr, dst *uint16) (int, error)

CopyUint16In is a convenient wrapper for copying in a uint16 from the task's memory.

func CopyUint16Out

func CopyUint16Out(cc marshal.CopyContext, addr hostarch.Addr, src uint16) (int, error)

CopyUint16Out is a convenient wrapper for copying out a uint16 to the task's memory.

func CopyUint32In

func CopyUint32In(cc marshal.CopyContext, addr hostarch.Addr, dst *uint32) (int, error)

CopyUint32In is a convenient wrapper for copying in a uint32 from the task's memory.

func CopyUint32Out

func CopyUint32Out(cc marshal.CopyContext, addr hostarch.Addr, src uint32) (int, error)

CopyUint32Out is a convenient wrapper for copying out a uint32 to the task's memory.

func CopyUint64In

func CopyUint64In(cc marshal.CopyContext, addr hostarch.Addr, dst *uint64) (int, error)

CopyUint64In is a convenient wrapper for copying in a uint64 from the task's memory.

func CopyUint64Out

func CopyUint64Out(cc marshal.CopyContext, addr hostarch.Addr, src uint64) (int, error)

CopyUint64Out is a convenient wrapper for copying out a uint64 to the task's memory.

func CopyUint8In

func CopyUint8In(cc marshal.CopyContext, addr hostarch.Addr, dst *uint8) (int, error)

CopyUint8In is a convenient wrapper for copying in a uint8 from the task's memory.

func CopyUint8Out

func CopyUint8Out(cc marshal.CopyContext, addr hostarch.Addr, src uint8) (int, error)

CopyUint8Out is a convenient wrapper for copying out a uint8 to the task's memory.

Types

type ByteSlice

type ByteSlice []byte

ByteSlice is a marshal.Marshallable implementation for []byte. This is a convenience wrapper around a dynamically sized type, and can't be embedded in other marshallable types because it breaks assumptions made by go-marshal internals. It violates the "no dynamically-sized types" constraint of the go-marshal library.

func (*ByteSlice) CopyIn

func (b *ByteSlice) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error)

CopyIn implements marshal.Marshallable.CopyIn.

func (*ByteSlice) CopyInN

func (b *ByteSlice) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error)

CopyInN implements marshal.Marshallable.CopyInN.

func (*ByteSlice) CopyOut

func (b *ByteSlice) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error)

CopyOut implements marshal.Marshallable.CopyOut.

func (*ByteSlice) CopyOutN

func (b *ByteSlice) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error)

CopyOutN implements marshal.Marshallable.CopyOutN.

func (*ByteSlice) MarshalBytes

func (b *ByteSlice) MarshalBytes(dst []byte) []byte

MarshalBytes implements marshal.Marshallable.MarshalBytes.

func (*ByteSlice) MarshalUnsafe

func (b *ByteSlice) MarshalUnsafe(dst []byte) []byte

MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.

func (*ByteSlice) Packed

func (b *ByteSlice) Packed() bool

Packed implements marshal.Marshallable.Packed.

func (*ByteSlice) SizeBytes

func (b *ByteSlice) SizeBytes() int

SizeBytes implements marshal.Marshallable.SizeBytes.

func (*ByteSlice) UnmarshalBytes

func (b *ByteSlice) UnmarshalBytes(src []byte) []byte

UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.

func (*ByteSlice) UnmarshalUnsafe

func (b *ByteSlice) UnmarshalUnsafe(src []byte) []byte

UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.

func (*ByteSlice) WriteTo

func (b *ByteSlice) WriteTo(w io.Writer) (int64, error)

WriteTo implements io.WriterTo.WriteTo.

type Int16

type Int16 int16

Int16 is a marshal.Marshallable implementation for int16.

+marshal boundCheck slice:Int16Slice:inner

type Int32

type Int32 int32

Int32 is a marshal.Marshallable implementation for int32.

+marshal boundCheck slice:Int32Slice:inner

type Int64

type Int64 int64

Int64 is a marshal.Marshallable implementation for int64.

+marshal boundCheck slice:Int64Slice:inner

type Int8

type Int8 int8

Int8 is a marshal.Marshallable implementation for int8.

+marshal boundCheck slice:Int8Slice:inner

type Uint16

type Uint16 uint16

Uint16 is a marshal.Marshallable implementation for uint16.

+marshal boundCheck slice:Uint16Slice:inner

type Uint32

type Uint32 uint32

Uint32 is a marshal.Marshallable implementation for uint32.

+marshal boundCheck slice:Uint32Slice:inner

type Uint64

type Uint64 uint64

Uint64 is a marshal.Marshallable implementation for uint64.

+marshal boundCheck slice:Uint64Slice:inner

type Uint8

type Uint8 uint8

Uint8 is a marshal.Marshallable implementation for uint8.

+marshal boundCheck slice:Uint8Slice:inner

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL