Struct lair_keystore::dependencies::sodoken::buffer::BufWriteMemLocked
source · pub struct BufWriteMemLocked(/* 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§
Trait Implementations§
source§impl AsBufExtend for BufWriteMemLocked
impl AsBufExtend for BufWriteMemLocked
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 AsBufRead for BufWriteMemLocked
impl AsBufRead for BufWriteMemLocked
source§fn try_unwrap(self: Arc<BufWriteMemLocked>) -> Result<Box<[u8]>, BufRead>
fn try_unwrap(self: Arc<BufWriteMemLocked>) -> 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.
source§impl AsBufWrite for BufWriteMemLocked
impl AsBufWrite for BufWriteMemLocked
source§fn write_lock(&self) -> WriteGuard<'_>
fn write_lock(&self) -> WriteGuard<'_>
Obtain write access to the underlying buffer.
source§fn into_read(self: Arc<BufWriteMemLocked>) -> BufRead
fn into_read(self: Arc<BufWriteMemLocked>) -> BufRead
Downgrade this to a read-only reference
without cloning internal data
and without changing memory locking strategy.
source§fn into_extend(self: Arc<BufWriteMemLocked>) -> BufExtend
fn into_extend(self: Arc<BufWriteMemLocked>) -> BufExtend
Transform this buffer into an extendable type.
Auto Trait Implementations§
impl !Freeze for BufWriteMemLocked
impl !RefUnwindSafe for BufWriteMemLocked
impl Send for BufWriteMemLocked
impl Sync for BufWriteMemLocked
impl Unpin for BufWriteMemLocked
impl UnwindSafe for BufWriteMemLocked
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more