[−][src]Trait serde_scale::Read
Interface to read bytes
Associated Types
Loading content...Required methods
fn read_map<R, F>(&mut self, n: usize, f: F) -> Result<R, Self::Error> where
F: FnOnce(Bytes<'a, '_>) -> R,
F: FnOnce(Bytes<'a, '_>) -> R,
Reads exactly n
bytes and passes them to the given function
An error must be returned if there are fewer than n
bytes left.
Provided methods
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Self::Error>
Reads exactly buf.len()
bytes and writes them to the supplied buffer
An error must be returned if there are fewer than buf.len()
bytes left.
Implementations on Foreign Types
impl<'a, T: Read<'a> + ?Sized, '_> Read<'a> for &'_ mut T
[src]
type Error = T::Error
fn read_map<R, F>(&mut self, n: usize, f: F) -> Result<R, Self::Error> where
F: FnOnce(Bytes<'a, '_>) -> R,
[src]
F: FnOnce(Bytes<'a, '_>) -> R,
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Self::Error>
[src]
impl<'a> Read<'a> for &'a [u8]
[src]
type Error = EndOfInput
fn read_map<R, F>(&mut self, n: usize, f: F) -> Result<R, Self::Error> where
F: FnOnce(Bytes<'a, '_>) -> R,
[src]
F: FnOnce(Bytes<'a, '_>) -> R,