pub struct Decoder<'a> { /* private fields */ }Expand description
A zero-copy, bounds-checked cursor over a byte slice.
Decoders are immutable views. Reading advances the internal cursor.
Container reads return new Decoder instances restricted to the container’s body.
§Errors
All read operations return Error::UnexpectedEnd if the buffer is exhausted.
Implementations§
Source§impl<'a> Decoder<'a>
impl<'a> Decoder<'a>
Sourcepub fn option_none(&mut self) -> Result<()>
pub fn option_none(&mut self) -> Result<()>
Decodes Option::None.
Sourcepub fn option(&mut self) -> Result<Option<Decoder<'a>>>
pub fn option(&mut self) -> Result<Option<Decoder<'a>>>
Decodes an Option.
Returns Some(Decoder) for the payload if present, or None.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Decoder<'a>
impl<'a> RefUnwindSafe for Decoder<'a>
impl<'a> Send for Decoder<'a>
impl<'a> Sync for Decoder<'a>
impl<'a> Unpin for Decoder<'a>
impl<'a> UnsafeUnpin for Decoder<'a>
impl<'a> UnwindSafe for Decoder<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more