BufferPullable

Trait BufferPullable 

Source
pub trait BufferPullable: Sized {
    // Required method
    fn pull_from_buffer<T: AsRef<[u8]>>(buffer: T) -> Result<Self, ScsiError>;
}
Expand description

Allows for a struct to deserialize itself from a raw byte buffer.

Required Methods§

Source

fn pull_from_buffer<T: AsRef<[u8]>>(buffer: T) -> Result<Self, ScsiError>

Deserializes an instance of T from a byte buffer.

#Errors

Can return a BufferTooSmall error when the length of buffer is not large enough to deserialize from, or a ParseError if the buffer cannot be deserialized into a valid instance of T using the bytes provided.

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§