struct Endian
pub struct Endian {
pub little bool
}Purpose
Structure encapsulating little.
Public fields
littlebool- field (bool)
#encoding/binaryEndian integers and uvarint/varint.
struct Endianpub struct Endian {
pub little bool
}Structure encapsulating little.
little boollittle_endianpub fn little_endian() EndianReturn Little-Endian byte-order codec.
No arguments are required.
Endian — a value of this type
big_endianpub fn big_endian() EndianReturn Big-Endian byte-order codec.
No arguments are required.
Endian — a value of this type
(Endian) get_u16pub fn (e Endian) get_u16(data &[]int, off int) intOperation on Endian: read u16. Throws on failure; handle the error or propagate it to the caller.
e EndianEndian instance used by this call (value receiver).data &[]intoff intint — a value of this type
(Endian) get_u32pub fn (e Endian) get_u32(data &[]int, off int) intOperation on Endian: read u32. Throws on failure; handle the error or propagate it to the caller.
e EndianEndian instance used by this call (value receiver).data &[]intoff intint — a value of this type
(Endian) get_u64pub fn (e Endian) get_u64(data &[]int, off int) intOperation on Endian: read u64. Throws on failure; handle the error or propagate it to the caller.
e EndianEndian instance used by this call (value receiver).data &[]intoff intint — a value of this type
(Endian) put_u16pub fn (e Endian) put_u16(data $&[]int, off int, v int) intOperation on Endian: put u16. Throws on failure; handle the error or propagate it to the caller.
e EndianEndian instance used by this call (value receiver).data $&[]intoff intv intint — a value of this type
(Endian) put_u32pub fn (e Endian) put_u32(data $&[]int, off int, v int) intOperation on Endian: put u32. Throws on failure; handle the error or propagate it to the caller.
e EndianEndian instance used by this call (value receiver).data $&[]intoff intv intint — a value of this type
(Endian) put_u64pub fn (e Endian) put_u64(data $&[]int, off int, v int) intOperation on Endian: put u64. Throws on failure; handle the error or propagate it to the caller.
e EndianEndian instance used by this call (value receiver).data $&[]intoff intv intint — a value of this type
native_endianpub fn native_endian() EndianReturn host native byte-order codec.
No arguments are required.
Endian — a value of this type
(Endian) get_i16pub fn (e Endian) get_i16(data &[]int, off int) intOperation on Endian: read i16.
e EndianEndian instance used by this call (value receiver).data &[]intoff intint — a value of this type
(Endian) get_i32pub fn (e Endian) get_i32(data &[]int, off int) intOperation on Endian: read i32.
e EndianEndian instance used by this call (value receiver).data &[]intoff intint — a value of this type
(Endian) get_i64pub fn (e Endian) get_i64(data &[]int, off int) intOperation on Endian: read i64.
e EndianEndian instance used by this call (value receiver).data &[]intoff intint — a value of this type
(Endian) put_i16pub fn (e Endian) put_i16(data $&[]int, off int, v int) intOperation on Endian: put i16.
e EndianEndian instance used by this call (value receiver).data $&[]intoff intv intint — a value of this type
(Endian) put_i32pub fn (e Endian) put_i32(data $&[]int, off int, v int) intOperation on Endian: put i32.
e EndianEndian instance used by this call (value receiver).data $&[]intoff intv intint — a value of this type
(Endian) put_i64pub fn (e Endian) put_i64(data $&[]int, off int, v int) intOperation on Endian: put i64.
e EndianEndian instance used by this call (value receiver).data $&[]intoff intv intint — a value of this type
put_uvarintpub fn put_uvarint(x int) stringEncode unsigned int as uvarint.
x intstring — result string
size_uvarintpub fn size_uvarint(x int) intSize uvarint.
x intint — a value of this type
uvarintpub fn uvarint(s &string) intDecode an unsigned uvarint from bytes. Throws on failure; handle the error or propagate it to the caller.
s &stringint — a value of this type
put_varintpub fn put_varint(x int) stringEncode signed int as ZigZag varint.
x intstring — result string
varintpub fn varint(s &string) intDecode a signed ZigZag varint from bytes. Throws on failure; handle the error or propagate it to the caller.
s &stringint — a value of this type
size_varintpub fn size_varint(x int) intSize varint.
x intint — a value of this type
append_uvarintpub fn append_uvarint(dst string, x int) stringAppend unsigned uvarint encoding to dst.
dst stringx intstring — result string
append_varintpub fn append_varint(dst string, x int) stringAppend signed varint encoding to dst.
dst stringx intstring — result string
(Endian) get_u16_bytespub fn (e Endian) get_u16_bytes(data &[]u8, off int) intOperation on Endian: read u16 bytes. Throws on failure; handle the error or propagate it to the caller.
e EndianEndian instance used by this call (value receiver).data &[]u8off intint — a value of this type
(Endian) get_u32_bytespub fn (e Endian) get_u32_bytes(data &[]u8, off int) intOperation on Endian: read u32 bytes. Throws on failure; handle the error or propagate it to the caller.
e EndianEndian instance used by this call (value receiver).data &[]u8off intint — a value of this type
(Endian) get_u64_bytespub fn (e Endian) get_u64_bytes(data &[]u8, off int) intOperation on Endian: read u64 bytes. Throws on failure; handle the error or propagate it to the caller.
e EndianEndian instance used by this call (value receiver).data &[]u8off intint — a value of this type
(Endian) put_u16_bytespub fn (e Endian) put_u16_bytes(data $&[]u8, off int, value int) intOperation on Endian: put u16 bytes. Throws on failure; handle the error or propagate it to the caller.
e EndianEndian instance used by this call (value receiver).data $&[]u8off intvalue intint — a value of this type
(Endian) put_u32_bytespub fn (e Endian) put_u32_bytes(data $&[]u8, off int, value int) intOperation on Endian: put u32 bytes. Throws on failure; handle the error or propagate it to the caller.
e EndianEndian instance used by this call (value receiver).data $&[]u8off intvalue intint — a value of this type
(Endian) put_u64_bytespub fn (e Endian) put_u64_bytes(data $&[]u8, off int, value int) intOperation on Endian: put u64 bytes. Throws on failure; handle the error or propagate it to the caller.
e EndianEndian instance used by this call (value receiver).data $&[]u8off intvalue intint — a value of this type
(Endian) get_i16_bytespub fn (e Endian) get_i16_bytes(data &[]u8, off int) intOperation on Endian: read i16 bytes. Throws on failure; handle the error or propagate it to the caller.
e EndianEndian instance used by this call (value receiver).data &[]u8off intint — a value of this type
(Endian) get_i32_bytespub fn (e Endian) get_i32_bytes(data &[]u8, off int) intOperation on Endian: read i32 bytes. Throws on failure; handle the error or propagate it to the caller.
e EndianEndian instance used by this call (value receiver).data &[]u8off intint — a value of this type
(Endian) get_i64_bytespub fn (e Endian) get_i64_bytes(data &[]u8, off int) intOperation on Endian: read i64 bytes. Throws on failure; handle the error or propagate it to the caller.
e EndianEndian instance used by this call (value receiver).data &[]u8off intint — a value of this type
(Endian) put_i16_bytespub fn (e Endian) put_i16_bytes(data $&[]u8, off int, value int) intOperation on Endian: put i16 bytes. Throws on failure; handle the error or propagate it to the caller.
e EndianEndian instance used by this call (value receiver).data $&[]u8off intvalue intint — a value of this type
(Endian) put_i32_bytespub fn (e Endian) put_i32_bytes(data $&[]u8, off int, value int) intOperation on Endian: put i32 bytes. Throws on failure; handle the error or propagate it to the caller.
e EndianEndian instance used by this call (value receiver).data $&[]u8off intvalue intint — a value of this type
(Endian) put_i64_bytespub fn (e Endian) put_i64_bytes(data $&[]u8, off int, value int) intOperation on Endian: put i64 bytes. Throws on failure; handle the error or propagate it to the caller.
e EndianEndian instance used by this call (value receiver).data $&[]u8off intvalue intint — a value of this type
(Endian) get_f32pub fn (e Endian) get_f32(data &[]u8, off int) f64Float interfaces operate on tight []u8. Binary32 is rounded from / expanded to Xu f64; binary64 preserves every bit, including signed zero and NaNs. Throws on failure; handle the error or propagate it to the caller.
e EndianEndian instance used by this call (value receiver).data &[]u8off intf64 — a value of this type
(Endian) get_f64pub fn (e Endian) get_f64(data &[]u8, off int) f64Operation on Endian: read f64. Throws on failure; handle the error or propagate it to the caller.
e EndianEndian instance used by this call (value receiver).data &[]u8off intf64 — a value of this type
(Endian) put_f32pub fn (e Endian) put_f32(data $&[]u8, off int, value f64) intOperation on Endian: put f32. Throws on failure; handle the error or propagate it to the caller.
e EndianEndian instance used by this call (value receiver).data $&[]u8off intvalue f64int — a value of this type
(Endian) put_f64pub fn (e Endian) put_f64(data $&[]u8, off int, value f64) intOperation on Endian: put f64. Throws on failure; handle the error or propagate it to the caller.
e EndianEndian instance used by this call (value receiver).data $&[]u8off intvalue f64int — a value of this type