Expand description
Provides various functions and structs for MessagePack decoding.
Most of the function defined in this module will silently handle interruption error (EINTR)
received from the given Read
to be in consistent state with the Write::write_all
method in
the standard library.
Any other error would immediately interrupt the parsing process. If your reader can results in
I/O error and simultaneously be a recoverable state (for example, when reading from
non-blocking socket and it returns EWOULDBLOCK) be sure that you buffer the data externally
to avoid data loss (using BufRead
readers with manual consuming or some other way).
Re-exports§
pub use bytes::Bytes;
Modules§
Structs§
- ExtMeta
- Extension type meta information.
- Marker
Read Error - An error that can occur when attempting to read a MessagePack marker from the reader.
Enums§
- Decode
String Error - NumValue
Read Error - An error which can occur when attempting to read a MessagePack numeric value from the reader.
- Value
Read Error - An error which can occur when attempting to read a MessagePack value from the reader.
Traits§
- RmpRead
- A type that
rmp
supports reading from. - RmpRead
Err - The error type for I/O operations on
RmpRead
and associated traits.
Functions§
- marker_
to_ len - read_
array_ len - Attempts to read up to 5 bytes from the given reader and to decode them as a big-endian u32 array size.
- read_
bin_ len - Attempts to read up to 5 bytes from the given reader and to decode them as Binary array length.
- read_
bool - Attempts to read a single byte from the given reader and to decode it as a boolean value.
- read_
ext_ meta - read_
f32 - Attempts to read exactly 5 bytes from the given reader and to decode them as
f32
value. - read_
f64 - Attempts to read exactly 9 bytes from the given reader and to decode them as
f64
value. - read_
fixext1 - Attempts to read exactly 3 bytes from the given reader and interpret them as a fixext1 type with data attached.
- read_
fixext2 - Attempts to read exactly 4 bytes from the given reader and interpret them as a fixext2 type with data attached.
- read_
fixext4 - Attempts to read exactly 6 bytes from the given reader and interpret them as a fixext4 type with data attached.
- read_
fixext8 - Attempts to read exactly 10 bytes from the given reader and interpret them as a fixext8 type with data attached.
- read_
fixext16 - Attempts to read exactly 18 bytes from the given reader and interpret them as a fixext16 type with data attached.
- read_i8
- Attempts to read exactly 2 bytes from the given reader and to decode them as
i8
value. - read_
i16 - Attempts to read exactly 3 bytes from the given reader and to decode them as
i16
value. - read_
i32 - Attempts to read exactly 5 bytes from the given reader and to decode them as
i32
value. - read_
i64 - Attempts to read exactly 9 bytes from the given reader and to decode them as
i64
value. - read_
int - Attempts to read up to 9 bytes from the given reader and to decode them as integral
T
value. - read_
map_ len - Attempts to read up to 5 bytes from the given reader and to decode them as a big-endian u32 map size.
- read_
marker - Attempts to read a single byte from the given reader and to decode it as a MessagePack marker.
- read_
nfix - Attempts to read a single byte from the given reader and to decode it as a negative fixnum value.
- read_
nil - Attempts to read a single byte from the given reader and to decode it as a nil value.
- read_
pfix - Attempts to read a single byte from the given reader and to decode it as a positive fixnum value.
- read_
str - Attempts to read a string data from the given reader and copy it to the buffer provided.
- read_
str_ from_ slice - Attempts to read and decode a string value from the reader, returning a borrowed slice from it.
- read_
str_ len - Attempts to read up to 9 bytes from the given reader and to decode them as a string
u32
size value. - read_
str_ ref Deprecated - Attempts to read and decode a string value from the reader, returning a borrowed slice from it.
- read_u8
- Attempts to read exactly 2 bytes from the given reader and to decode them as
u8
value. - read_
u16 - Attempts to read exactly 3 bytes from the given reader and to decode them as
u16
value. - read_
u32 - Attempts to read exactly 5 bytes from the given reader and to decode them as
u32
value. - read_
u64 - Attempts to read exactly 9 bytes from the given reader and to decode them as
u64
value.
Type Aliases§
- Error
Deprecated - An alias to the “default” error handling type.