TryExtractPayloadFrom

Trait TryExtractPayloadFrom 

Source
pub trait TryExtractPayloadFrom<T: Sized> {
    // Required method
    fn try_read<B: Read + Seek>(
        buf: &mut B,
        header: &PayloadHeader,
    ) -> Result<ReadStatus<T>, Error>;
}
Expand description

Trait for attempting to extract a payload with error or pending result.

Similar to TryReadPayloadFrom, but typically implemented manually.

Required Methods§

Source

fn try_read<B: Read + Seek>( buf: &mut B, header: &PayloadHeader, ) -> Result<ReadStatus<T>, Error>

Attempts to read the payload, returning status instead of panicking on incomplete data.

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§