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§

source

fn read_data<T: PlainData>(&mut self) -> Result<T>

Decode a PlainData at the start of this stream.

source

fn read_optional<T>(&mut self) -> Result<Option<T>>
where Option<T>: PlainData,

Convenience function for read::<Option<T>>.

source

fn read_n<T: Decode<()>>(&mut self, n: usize) -> Result<Vec<T>>

Decode a series of N Decode at the start of this stream.

source

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.

source

fn read_string(&mut self) -> Result<String>

Decode a length n, and then a string of length n.

source

fn check_magic<M: Into<Magic>>(&mut self, magic: M) -> Result<()>

Decode and assert a 32bit magic.

source

fn drop_padding(&mut self, hint: &str, n: usize) -> Result<()>

Drop some information we possibly do not understand yet.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<S: Read + ?Sized> Stream for S