internal

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Uint8Bytes = 1 << iota
	// uint16Bytes the number of bytes in an uint16.
	Uint16Bytes
	// uint32Bytes the number of bytes in an uint32.
	Uint32Bytes
	// uint64Bytes the number of bytes in an uint64.
	Uint64Bytes
)

Variables

View Source
var (
	ErrShort         = errors.New("short")
	ErrUnsupported   = errors.New("unsupported")
	ErrUnaddressable = errors.New("unaddressable")
)

Error to be used by sub packages. These will be overridden by bytes

Functions

func CanCopyFrom

func CanCopyFrom(src, dst, size int) (bool, error)

CanCopyFrom returns if src can be copied to dst This returns true if src can fit in dst and len(src)>0

func CanCopyTo

func CanCopyTo(src, dst, size int) (bool, error)

CanCopyTo returns if src can be copied to dst This returns true if src can fit in dst and len(src)>0

func CanFitCopyFrom

func CanFitCopyFrom(src, dst, size int) bool

CanFitCopyFrom returns if dst is large enough to fit src if src has a element size of `size`

func CanFitCopyTo

func CanFitCopyTo(src, dst, size int) bool

CanFitCopyTo returns if dst is large enough to fit src if dst has a element size of `size`

func IsSafeSlice

func IsSafeSlice(t reflect.Type) bool

IsSafeSlice returns if the given type is a slice or array, with a element type that can be safely converted to bytes. All signed and unsigned intergers except uint and int, and floats are considered to be safe types. uint and int are considered to be unsafe since their size is platform dependent.

Types

type Provider

type Provider interface {
	FromI8([]int8, []byte) int
	FromI16([]int16, []byte, bool) int
	FromI32([]int32, []byte, bool) int
	FromI64([]int64, []byte, bool) int
	FromU16([]uint16, []byte, bool) int
	FromU32([]uint32, []byte, bool) int
	FromU64([]uint64, []byte, bool) int
	FromF32([]float32, []byte, bool) int
	FromF64([]float64, []byte, bool) int
	ToI8([]uint8, []int8) int
	ToI16([]byte, []int16, bool) int
	ToI32([]byte, []int32, bool) int
	ToI64([]byte, []int64, bool) int
	ToU16([]byte, []uint16, bool) int
	ToU32([]byte, []uint32, bool) int
	ToU64([]byte, []uint64, bool) int
	ToF32([]byte, []float32, bool) int
	ToF64([]byte, []float64, bool) int
	FromSlice(interface{}, []byte, bool) (int, error)
	ToSlice([]byte, interface{}, bool) (int, error)
	FromValue(reflect.Value, []byte, bool) (int, error)
	ToValue([]byte, reflect.Value, bool) (int, error)
}

Provider a provider

Directories

Path Synopsis
asm
asm/gen command

Jump to

Keyboard shortcuts

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