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>

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>

§

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>

§

fn len(&self) -> usize

The length of this buffer.
§

fn is_empty(&self) -> bool

Is this buffer empty?
§

fn read_lock(&self) -> ReadGuard<'_>

Obtain read access to the underlying buffer.
§

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>

§

fn read_lock_sized(&self) -> ReadGuardSized<'_, N>

Obtain read access to the underlying buffer.
§

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>>

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>

§

fn write_lock(&self) -> WriteGuard<'_>

Obtain write access to the underlying buffer.
§

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

Transform this buffer into an extendable type.
§

impl<const N: usize> AsBufWriteSized<N> for BufWriteMemLockedSized<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>

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

Convert to an unsized BufWrite instance without cloning internal data and without changing memory locking strategy.
§

impl<const N: usize> Debug for BufWriteMemLockedSized<N>

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more