Trait epserde::deser::read::ReadWithPos

source ·
pub trait ReadWithPos: ReadNoStd + Sized {
    // Required methods
    fn pos(&self) -> usize;
    fn align<T: MaxSizeOf>(&mut self) -> Result<()>;
}
Expand description

A trait for ReadNoStd that also keeps track of the current position.

This is needed because the Read trait doesn’t have a seek method and std::io::Seek would be a requirement much stronger than needed.

Required Methods§

source

fn pos(&self) -> usize

Return the current position.

source

fn align<T: MaxSizeOf>(&mut self) -> Result<()>

Pad the cursor to the next multiple of MaxSizeOf::max_size_of ‘T’.

Object Safety§

This trait is not object safe.

Implementors§