pub trait AsBufReadSized<const N: usize>: 'static + AsBufRead + Debug + Send + Sync {
    // Required methods
    fn read_lock_sized(&self) -> ReadGuardSized<'_, N>;
    fn into_read_unsized(self: Arc<Self>) -> BufRead;
    fn try_unwrap_sized(self: Arc<Self>) -> Result<[u8; N], BufReadSized<N>>;
}
Expand description

A sized readable buffer that may or may not be mem_locked.

Required Methods§

source

fn read_lock_sized(&self) -> ReadGuardSized<'_, N>

Obtain read access to the underlying buffer.

source

fn into_read_unsized(self: Arc<Self>) -> BufRead

Convert to an unsized BufRead instance without cloning internal data and without changing memory locking strategy.

source

fn try_unwrap_sized(self: Arc<Self>) -> Result<[u8; N], BufReadSized<N>>

Attempt to extract the inner contents of this buf without cloning. If this memory is locked or there are clones of this reference, the unwrap will fail, returning a BufRead instance.

Implementations on Foreign Types§

source§

impl<const N: usize> AsBufReadSized<N> for RwLock<[u8; N]>

source§

impl<const N: usize> AsBufReadSized<N> for [u8; N]

Implementors§