Trait PodReadExt

Source
pub trait PodReadExt {
    // Required methods
    fn read_pod<P: Pod>(&mut self) -> Result<P>;
    fn read_pod_or_none<P: Pod>(&mut self) -> Result<Option<P>>;
}
Expand description

An extension trait for reading Pod types from std::io::Read data streams.

Required Methods§

Source

fn read_pod<P: Pod>(&mut self) -> Result<P>

Reads a Pod struct from the stream. Behaves like read_exact, and will produce an error if EOF is encountered before the data is fully read.

Source

fn read_pod_or_none<P: Pod>(&mut self) -> Result<Option<P>>

Reads a Pod struct from the stream, or nothing at EOF. Partial reads will result in an error.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T: Read> PodReadExt for T