Struct sodoken::buffer::BufWriteMemLockedSized
source · pub struct BufWriteMemLockedSized<const N: usize>(/* private fields */);
Expand description
This writable buffer type is mem_locked. Use this for passwords / private keys, etc, but NOT everything, locked memory is a finite resource.
Implementations§
source§impl<const N: usize> BufWriteMemLockedSized<N>
impl<const N: usize> BufWriteMemLockedSized<N>
sourcepub fn new() -> SodokenResult<Self>
pub fn new() -> SodokenResult<Self>
Construct a new writable, mem_locked buffer. Use this for passwords / private keys, etc, but NOT everything, locked memory is a finite resource.
Trait Implementations§
source§impl<const N: usize> AsBufExtend for BufWriteMemLockedSized<N>
impl<const N: usize> AsBufExtend for BufWriteMemLockedSized<N>
source§fn extend_lock(&self) -> ExtendGuard<'_>
fn extend_lock(&self) -> ExtendGuard<'_>
Obtain access to extend the underlying buffer.
Warning: Depending on the underlying data type,
each new ExtendGuard could be a new cursor… i.e.
pulling a new extend lock could overwrite previous data.
source§impl<const N: usize> AsBufRead for BufWriteMemLockedSized<N>
impl<const N: usize> AsBufRead for BufWriteMemLockedSized<N>
source§impl<const N: usize> AsBufReadSized<N> for BufWriteMemLockedSized<N>
impl<const N: usize> AsBufReadSized<N> for BufWriteMemLockedSized<N>
source§fn read_lock_sized(&self) -> ReadGuardSized<'_, N>
fn read_lock_sized(&self) -> ReadGuardSized<'_, N>
Obtain read access to the underlying buffer.
source§fn into_read_unsized(self: Arc<Self>) -> BufRead
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>>
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.
source§impl<const N: usize> AsBufWrite for BufWriteMemLockedSized<N>
impl<const N: usize> AsBufWrite for BufWriteMemLockedSized<N>
source§fn write_lock(&self) -> WriteGuard<'_>
fn write_lock(&self) -> WriteGuard<'_>
Obtain write access to the underlying buffer.
source§fn into_read(self: Arc<Self>) -> BufRead
fn into_read(self: Arc<Self>) -> BufRead
Downgrade this to a read-only reference
without cloning internal data
and without changing memory locking strategy.
source§fn into_extend(self: Arc<Self>) -> BufExtend
fn into_extend(self: Arc<Self>) -> BufExtend
Transform this buffer into an extendable type.
source§impl<const N: usize> AsBufWriteSized<N> for BufWriteMemLockedSized<N>
impl<const N: usize> AsBufWriteSized<N> for BufWriteMemLockedSized<N>
source§fn write_lock_sized(&self) -> WriteGuardSized<'_, N>
fn write_lock_sized(&self) -> WriteGuardSized<'_, N>
Obtain write access to the underlying buffer.
source§fn into_read_sized(self: Arc<Self>) -> BufReadSized<N>
fn into_read_sized(self: Arc<Self>) -> BufReadSized<N>
Downgrade this to a read-only reference
without cloning internal data
and without changing memory locking strategy.
source§fn into_write_unsized(self: Arc<Self>) -> BufWrite
fn into_write_unsized(self: Arc<Self>) -> BufWrite
Convert to an unsized BufWrite instance
without cloning internal data
and without changing memory locking strategy.
Auto Trait Implementations§
impl<const N: usize> !RefUnwindSafe for BufWriteMemLockedSized<N>
impl<const N: usize> Send for BufWriteMemLockedSized<N>
impl<const N: usize> Sync for BufWriteMemLockedSized<N>
impl<const N: usize> Unpin for BufWriteMemLockedSized<N>
impl<const N: usize> UnwindSafe for BufWriteMemLockedSized<N>
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