Struct rmp::decode::bytes::Bytes [−][src]
pub struct Bytes<'a> { /* fields omitted */ }
Expand description
A wrapper around &[u8]
to read more efficiently.
This has a specialized implementation of RmpWrite
and has error type Infallible.
This has the additional benefit of working on #[no_std]
(unlike the builtin Read trait)
See also serde_bytes::Bytes
Unlike a plain &[u8]
this also tracks an internal offset in the input (See Self::position).
This is used for (limited) compatibility with std::io::Cursor. Unlike a Cursor it does not support mark/reset.
Implementations
Wrap an existing bytes slice.
This sets the internal position to zero.
Get a reference to the remaining bytes in the buffer.
Return the position of the input buffer.
This is not required for correctness, it only exists to help mimic Cursor::position
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl<'a> RefUnwindSafe for Bytes<'a>
impl<'a> UnwindSafe for Bytes<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more