BufferPushable

Trait BufferPushable 

Source
pub trait BufferPushable {
    // Required method
    fn push_to_buffer<T: AsMut<[u8]>>(
        &self,
        buffer: T,
    ) -> Result<usize, ScsiError>;
}
Expand description

Allows a struct to serialize itself to a raw byte buffer.

Required Methods§

Source

fn push_to_buffer<T: AsMut<[u8]>>(&self, buffer: T) -> Result<usize, ScsiError>

Serializes self to a raw byte slice.

Returns the number of bytes written on succes.

#Errors

Can return a BufferTooSmall error when the length of buffer is not large enough to serialize to.

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§