[][src]Trait sodoken::AsBuffer

pub trait AsBuffer: 'static + Debug + Send + Sync {
    pub fn deep_clone(&self) -> SodokenResult<Buffer>;
pub fn read_lock(&self) -> ReadGuard<'_>;
pub fn write_lock(&self) -> WriteGuard<'_>; pub fn to_boxed_slice(&self) -> Box<[u8]> { ... } }

A buffer represents an array of bytes that may or may not be memory locked.

Required methods

pub fn deep_clone(&self) -> SodokenResult<Buffer>[src]

Deep clone the actual bytes of this buffer. The type (memlocked or not) will be retained. Not to be confused with "clone" on the Buffer struct, which just bumps a refcount.

pub fn read_lock(&self) -> ReadGuard<'_>[src]

Obtain read access to the underlying buffer.

pub fn write_lock(&self) -> WriteGuard<'_>[src]

Obtain write access to the underlying buffer.

Loading content...

Provided methods

pub fn to_boxed_slice(&self) -> Box<[u8]>[src]

Provided method to extract this instance into a boxed slice. Be sure you are not exposing something that should be kept protected.

Loading content...

Implementors

impl AsBuffer for Buffer[src]

Loading content...