Trait reanim_decode::stream::Stream
source · pub trait Stream: Read {
// Provided methods
fn read_data<T: PlainData>(&mut self) -> Result<T> { ... }
fn read_optional<T>(&mut self) -> Result<Option<T>>
where Option<T>: PlainData { ... }
fn read_n<T: Decode<()>>(&mut self, n: usize) -> Result<Vec<T>> { ... }
fn read_array<T: Decode<()>>(&mut self) -> Result<Vec<T>> { ... }
fn read_string(&mut self) -> Result<String> { ... }
fn check_magic<M: Into<Magic>>(&mut self, magic: M) -> Result<()> { ... }
fn drop_padding(&mut self, hint: &str, n: usize) -> Result<()> { ... }
}Expand description
Stream decoding API on top of Read.
Provided Methods§
sourcefn read_data<T: PlainData>(&mut self) -> Result<T>
fn read_data<T: PlainData>(&mut self) -> Result<T>
Decode a PlainData at the start of this stream.
sourcefn read_optional<T>(&mut self) -> Result<Option<T>>
fn read_optional<T>(&mut self) -> Result<Option<T>>
Convenience function for read::<Option<T>>.
sourcefn read_n<T: Decode<()>>(&mut self, n: usize) -> Result<Vec<T>>
fn read_n<T: Decode<()>>(&mut self, n: usize) -> Result<Vec<T>>
Decode a series of N Decode at the start of this stream.
sourcefn read_array<T: Decode<()>>(&mut self) -> Result<Vec<T>>
fn read_array<T: Decode<()>>(&mut self) -> Result<Vec<T>>
Decode a length n, and an array of n Decode at the start of this stream.
sourcefn read_string(&mut self) -> Result<String>
fn read_string(&mut self) -> Result<String>
Decode a length n, and then a string of length n.
Object Safety§
This trait is not object safe.