Struct fadroma::bin_serde::Deserializer
source · pub struct Deserializer<'a> { /* private fields */ }
Implementations§
source§impl<'a> Deserializer<'a>
impl<'a> Deserializer<'a>
pub fn deserialize<T: FadromaDeserialize>(&mut self) -> Result<T>
sourcepub fn read(&mut self, n: usize) -> Result<&[u8]>
pub fn read(&mut self, n: usize) -> Result<&[u8]>
Read the specified number of bytes or return
an Error::EndOfStream
if attempting to read
more bytes than currently available. If this
method succeeds it is guaranteed to return
the exact number of bytes requested.
sourcepub fn read_byte(&mut self) -> Result<u8>
pub fn read_byte(&mut self) -> Result<u8>
Convenience method for reading a single byte.
Has the same semantics as Deserializer::read
.
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the total number of bytes available for reading. This means that it does not account for how many have been read thus far.
sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Returns true
if all available bytes have been read.
Trait Implementations§
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Deserializer<'a>
impl<'a> Send for Deserializer<'a>
impl<'a> Sync for Deserializer<'a>
impl<'a> Unpin for Deserializer<'a>
impl<'a> UnwindSafe for Deserializer<'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