Documentation ¶
Index ¶
- Variables
- func Decode(buf []byte, value Decodable) error
- func DecodeByteSlice(r io.Reader) ([]byte, int, error)
- func DecodeCompact16(r io.Reader) (uint16, int, error)
- func DecodeFrom(r io.Reader, value Decodable) (int, error)
- func DecodeLen(r io.Reader) (uint32, int, error)
- func DecodeSlice[V any, H scale.DecodablePtr[V]](buf []byte) ([]V, error)
- func DecodeSliceFromReader[V any, H scale.DecodablePtr[V]](r io.Reader) ([]V, error)
- func DecodeStringSlice(r io.Reader) ([]string, int, error)
- func DecodeStringWithLimit(r io.Reader, limit uint32) (string, int, error)
- func Encode(value Encodable) ([]byte, error)
- func EncodeByteSlice(w io.Writer, value []byte) (int, error)
- func EncodeCompact16(w io.Writer, value uint16) (int, error)
- func EncodeLen(w io.Writer, value uint32) (int, error)
- func EncodeSlice[V any, H scale.EncodablePtr[V]](value []V) ([]byte, error)
- func EncodeStringSlice(w io.Writer, value []string) (int, error)
- func EncodeTo(w io.Writer, value Encodable) (int, error)
- func MustDecode(buf []byte, value Decodable)
- func MustDecodeSliceFromReader[V any, H scale.DecodablePtr[V]](r io.Reader) []V
- func MustEncode(value Encodable) []byte
- func MustEncodeSlice[V any, H scale.EncodablePtr[V]](value []V) []byte
- func MustEncodeTo(w io.Writer, value Encodable)
- func ReadSlice[V any, H scale.DecodablePtr[V]](r io.Reader) ([]V, int, error)
- type Decodable
- type Encodable
Constants ¶
This section is empty.
Variables ¶
var ErrShortRead = errors.New("decode from buffer: not all bytes were consumed")
Functions ¶
func DecodeByteSlice ¶
DecodeByteSlice decodes []string from an io.Reader.
func DecodeCompact16 ¶
DecodeCompact16 decodes uint16 from an io.Reader.
func DecodeFrom ¶
DecodeFrom decodes a value using data from a reader stream.
func DecodeSlice ¶
DecodeSlice decodes slice from a buffer.
func DecodeSliceFromReader ¶ added in v1.4.3
DecodeSliceFromReader accepts a reader and decodes slice with a length prefix.
func DecodeStringSlice ¶
DecodeStringSlice decodes []string from an io.Reader.
func DecodeStringWithLimit ¶ added in v1.4.1
DecodeStringWithLimit decodes a string from an io.Reader, limiting the maximum length.
func EncodeByteSlice ¶
EncodeByteSlice encodes []string to an io.Writer.
func EncodeCompact16 ¶
EncodeCompact16 encodes uint16 to an io.Writer.
func EncodeSlice ¶
EncodeSlice encodes slice with a length prefix.
func EncodeStringSlice ¶
EncodeStringSlice encodes []string to an io.Writer.
func MustDecode ¶
func MustDecodeSliceFromReader ¶ added in v1.4.3
MustDecodeSliceFromReader decodes slice with a length prefix or panics on error.
func MustEncode ¶
func MustEncodeSlice ¶ added in v1.4.3
MustEncodeSlice encodes slice with a length prefix or panics on error.