Trait sodoken::buffer::AsBufRead[][src]

pub trait AsBufRead: 'static + Debug + Send + Sync {
    fn len(&self) -> usize;
fn is_empty(&self) -> bool;
fn read_lock(&self) -> ReadGuard<'_>;
fn try_unwrap(self: Arc<Self>) -> Result<Box<[u8]>, BufRead>; }
Expand description

A readable buffer that may or may not be mem_locked.

Required methods

The length of this buffer.

Is this buffer empty?

Obtain read access to the underlying buffer.

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

Implementors