uns

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToString

func BytesToString(bs []byte) string

func Convert

func Convert[SRC, DST any](src SRC) DST

func ConvertPointer

func ConvertPointer[SRC, DST any](src *SRC) *DST

func Copy

func Copy(dst, src unsafe.Pointer, size int)

func FromPointer

func FromPointer[SRC, DST any](src *SRC) DST

func MakeBytes

func MakeBytes(ptr unsafe.Pointer, len, cap int) []byte

func MakeBytesUnchecked

func MakeBytesUnchecked(ptr unsafe.Pointer, len, cap int) (bs []byte)

func MakeSlice

func MakeSlice[E any](ptr unsafe.Pointer, len, cap int) []E

func MakeSliceUnchecked

func MakeSliceUnchecked[E any](ptr unsafe.Pointer, len, cap int) (es []E)

func MakeString

func MakeString(ptr unsafe.Pointer, len int) string

func SliceConvert

func SliceConvert[EI, EO any](s []EI, len, cap int) []EO

func SliceMerge

func SliceMerge[E any](s1, s2 []E) []E

func SlicePointer

func SlicePointer[E any](s []E) unsafe.Pointer

func SliceStructToSlice

func SliceStructToSlice[E any](ss SliceStruct) []E

func StringToBytes

func StringToBytes(s string) []byte

func ToPointer

func ToPointer[X any](x X) unsafe.Pointer

func Unescape

func Unescape[O any](op *O) *O

Types

type Buffer

type Buffer struct {
	Buf      []byte
	Off      int
	LastRead int8
}

func BufferOf

func BufferOf(buf *bytes.Buffer) *Buffer

type BufferWriter

type BufferWriter struct {
	// contains filtered or unexported fields
}

func NewBufferWriter

func NewBufferWriter(buf []byte) *BufferWriter

func (*BufferWriter) Write

func (w *BufferWriter) Write(data []byte)

func (*BufferWriter) WriteByte

func (w *BufferWriter) WriteByte(b byte)

func (*BufferWriter) WriteString

func (w *BufferWriter) WriteString(s string)

type BytesStruct

type BytesStruct SliceStruct

func BytesStructOf

func BytesStructOf(bs []byte) BytesStruct

func BytesStructOfPtr

func BytesStructOfPtr(bsp *[]byte) *BytesStruct

func BytesStructOfString

func BytesStructOfString(s string) *BytesStruct

func (*BytesStruct) Bytes

func (bss *BytesStruct) Bytes() []byte

func (*BytesStruct) ToString

func (bss *BytesStruct) ToString() string

func (*BytesStruct) ToStringStruct

func (bss *BytesStruct) ToStringStruct() StringStruct

type SliceStruct

type SliceStruct struct {
	Ptr unsafe.Pointer
	Len int
	Cap int
}

func SliceStructOf

func SliceStructOf[E any](s []E) SliceStruct

func SliceStructOfPtr

func SliceStructOfPtr[E any](sp *[]E) *SliceStruct

type StringStruct

type StringStruct struct {
	Ptr unsafe.Pointer
	Len int
}

func StringStructOf

func StringStructOf(s string) StringStruct

func StringStructOfPtr

func StringStructOfPtr(sp *string) *StringStruct

func (*StringStruct) Bytes

func (ss *StringStruct) Bytes() []byte

func (*StringStruct) ToBytesStruct

func (ss *StringStruct) ToBytesStruct() *BytesStruct

func (*StringStruct) ToString

func (ss *StringStruct) ToString() string

Directories

Path Synopsis
package goarch contains GOARCH-specific constants.
package goarch contains GOARCH-specific constants.
package goos contains GOOS-specific constants.
package goos contains GOOS-specific constants.

Jump to

Keyboard shortcuts

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