Skip to main content

WriteBufStorage

Trait WriteBufStorage 

Source
pub trait WriteBufStorage: Default + 'static {
    // Required methods
    fn as_slice(&self) -> &[u8] ;
    fn as_mut_slice(&mut self) -> &mut [u8] ;
}
Expand description

Storage abstraction for a slot’s outbound staging buffer.

Stable Rust can’t write [u8; <L as CodecLayer>::WRITE_BUF_CAP] because the array length isn’t known unless generic_const_exprs is enabled, so the buffer type is associated rather than const-sized: () for layers that don’t stage (zero bytes per slot), WriteBufArr for layers that do.

Required Methods§

Source

fn as_slice(&self) -> &[u8]

Source

fn as_mut_slice(&mut self) -> &mut [u8]

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.

Implementations on Foreign Types§

Source§

impl WriteBufStorage for ()

Source§

fn as_slice(&self) -> &[u8]

Source§

fn as_mut_slice(&mut self) -> &mut [u8]

Implementors§