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) -> Self
pub fn deep_clone_no_lock<O>(o: O) -> Self
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>
pub fn deep_clone_mem_locked<O>(o: O) -> SodokenResult<Self>
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.
Auto Trait Implementations§
impl !RefUnwindSafe for BufWrite
impl Send for BufWrite
impl Sync for BufWrite
impl Unpin for BufWrite
impl !UnwindSafe for BufWrite
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more