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§
§impl<const N: usize> BufWriteMemLockedSized<N>
impl<const N: usize> BufWriteMemLockedSized<N>
pub fn new() -> Result<BufWriteMemLockedSized<N>, OneErr>
pub fn new() -> Result<BufWriteMemLockedSized<N>, OneErr>
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§
§impl<const N: usize> AsBufExtend for BufWriteMemLockedSized<N>
impl<const N: usize> AsBufExtend for BufWriteMemLockedSized<N>
§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.
§impl<const N: usize> AsBufRead for BufWriteMemLockedSized<N>
impl<const N: usize> AsBufRead for BufWriteMemLockedSized<N>
§fn try_unwrap(
self: Arc<BufWriteMemLockedSized<N>>
) -> Result<Box<[u8]>, BufRead>
fn try_unwrap( self: Arc<BufWriteMemLockedSized<N>> ) -> Result<Box<[u8]>, BufRead>
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.
§impl<const N: usize> AsBufReadSized<N> for BufWriteMemLockedSized<N>
impl<const N: usize> AsBufReadSized<N> for BufWriteMemLockedSized<N>
§fn read_lock_sized(&self) -> ReadGuardSized<'_, N>
fn read_lock_sized(&self) -> ReadGuardSized<'_, N>
Obtain read access to the underlying buffer.
§fn into_read_unsized(self: Arc<BufWriteMemLockedSized<N>>) -> BufRead
fn into_read_unsized(self: Arc<BufWriteMemLockedSized<N>>) -> BufRead
Convert to an unsized BufRead instance
without cloning internal data
and without changing memory locking strategy.
§fn try_unwrap_sized(
self: Arc<BufWriteMemLockedSized<N>>
) -> Result<[u8; N], BufReadSized<N>>
fn try_unwrap_sized( self: Arc<BufWriteMemLockedSized<N>> ) -> 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.
§impl<const N: usize> AsBufWrite for BufWriteMemLockedSized<N>
impl<const N: usize> AsBufWrite for BufWriteMemLockedSized<N>
§fn write_lock(&self) -> WriteGuard<'_>
fn write_lock(&self) -> WriteGuard<'_>
Obtain write access to the underlying buffer.
§fn into_read(self: Arc<BufWriteMemLockedSized<N>>) -> BufRead
fn into_read(self: Arc<BufWriteMemLockedSized<N>>) -> BufRead
Downgrade this to a read-only reference
without cloning internal data
and without changing memory locking strategy.
§fn into_extend(self: Arc<BufWriteMemLockedSized<N>>) -> BufExtend
fn into_extend(self: Arc<BufWriteMemLockedSized<N>>) -> BufExtend
Transform this buffer into an extendable type.
§impl<const N: usize> AsBufWriteSized<N> for BufWriteMemLockedSized<N>
impl<const N: usize> AsBufWriteSized<N> for BufWriteMemLockedSized<N>
§fn write_lock_sized(&self) -> WriteGuardSized<'_, N>
fn write_lock_sized(&self) -> WriteGuardSized<'_, N>
Obtain write access to the underlying buffer.
§fn into_read_sized(self: Arc<BufWriteMemLockedSized<N>>) -> BufReadSized<N>
fn into_read_sized(self: Arc<BufWriteMemLockedSized<N>>) -> BufReadSized<N>
Downgrade this to a read-only reference
without cloning internal data
and without changing memory locking strategy.
§fn into_write_unsized(self: Arc<BufWriteMemLockedSized<N>>) -> BufWrite
fn into_write_unsized(self: Arc<BufWriteMemLockedSized<N>>) -> 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