pub struct BufWrite(pub Arc<dyn AsBufWrite>);
Expand description
A concrete writable buffer type that may or may not be mem_locked.
Tuple Fields§
§0: Arc<dyn AsBufWrite>
Implementations§
source§impl BufWrite
impl BufWrite
sourcepub fn new_no_lock(size: usize) -> Self
pub fn new_no_lock(size: usize) -> Self
Construct a new BufWrite that is NOT mem_locked.
sourcepub fn new_mem_locked(size: usize) -> SodokenResult<Self>
pub fn new_mem_locked(size: usize) -> SodokenResult<Self>
Construct a new BufWrite that IS mem_locked. Use this for passwords / private keys, etc, but NOT everything, locked memory is a finite resource.
sourcepub fn deep_clone_no_lock<O>(o: O) -> Selfwhere
O: Into<BufRead> + 'static + Send,
pub fn deep_clone_no_lock<O>(o: O) -> Selfwhere
O: Into<BufRead> + 'static + Send,
Deep clone the data referred to by another buffer object, into a new non-memory-locked BufWrite instance.
sourcepub fn deep_clone_mem_locked<O>(o: O) -> SodokenResult<Self>where
O: Into<BufRead> + 'static + Send,
pub fn deep_clone_mem_locked<O>(o: O) -> SodokenResult<Self>where
O: Into<BufRead> + 'static + Send,
Deep clone the data referred to by another buffer object, into a new MEMORY LOCKED BufWrite instance.
sourcepub fn write_lock(&self) -> WriteGuard<'_>
pub fn write_lock(&self) -> WriteGuard<'_>
Obtain write access to the underlying buffer.
Trait Implementations§
source§impl<const S: usize> From<BufWriteSized<S>> for BufWrite
impl<const S: usize> From<BufWriteSized<S>> for BufWrite
source§fn from(b: BufWriteSized<S>) -> Self
fn from(b: BufWriteSized<S>) -> Self
Converts to this type from the input type.