Struct holochain::prelude::dependencies::kitsune_p2p_types::dependencies::lair_keystore_api::dependencies::hc_seed_bundle::dependencies::sodoken::BufWriteSized
source · pub struct BufWriteSized<const N: usize>(pub Arc<dyn AsBufWriteSized<N>, Global>);
Expand description
A concrete sized writable buffer type that may or may not be mem_locked.
Tuple Fields§
§0: Arc<dyn AsBufWriteSized<N>, Global>
Implementations§
source§impl<const N: usize> BufWriteSized<N>
impl<const N: usize> BufWriteSized<N>
sourcepub fn new_no_lock() -> BufWriteSized<N>
pub fn new_no_lock() -> BufWriteSized<N>
Consruct a new BufWrite that is NOT mem_locked.
sourcepub fn new_mem_locked() -> Result<BufWriteSized<N>, OneErr>
pub fn new_mem_locked() -> Result<BufWriteSized<N>, OneErr>
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) -> BufWriteSized<N>where
O: Into<BufReadSized<N>> + 'static + Send,
pub fn deep_clone_no_lock<O>(o: O) -> BufWriteSized<N>where O: Into<BufReadSized<N>> + 'static + Send,
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) -> Result<BufWriteSized<N>, OneErr>where
O: Into<BufReadSized<N>> + 'static + Send,
pub fn deep_clone_mem_locked<O>(o: O) -> Result<BufWriteSized<N>, OneErr>where O: Into<BufReadSized<N>> + 'static + Send,
Deep clone the data referred to by another buffer object, into a new MEMORY LOCKED BufWrite instance.
sourcepub fn read_lock_sized(&self) -> ReadGuardSized<'_, N>
pub fn read_lock_sized(&self) -> ReadGuardSized<'_, N>
Obtain read access to the underlying buffer.
sourcepub fn to_read_unsized(&self) -> BufRead
pub fn to_read_unsized(&self) -> BufRead
Convert to an unsized BufRead instance without cloning internal data and without changing memory locking strategy.
sourcepub fn write_lock(&self) -> WriteGuard<'_>
pub fn write_lock(&self) -> WriteGuard<'_>
Obtain write access to the underlying buffer.
sourcepub fn to_read(&self) -> BufRead
pub fn to_read(&self) -> BufRead
Downgrade this to a read-only reference without cloning internal data and without changing memory locking strategy.
sourcepub fn write_lock_sized(&self) -> WriteGuardSized<'_, N>
pub fn write_lock_sized(&self) -> WriteGuardSized<'_, N>
Obtain write access to the underlying buffer.
sourcepub fn to_read_sized(&self) -> BufReadSized<N>
pub fn to_read_sized(&self) -> BufReadSized<N>
Downgrade this to a read-only reference without cloning internal data and without changing memory locking strategy.
sourcepub fn to_write_unsized(&self) -> BufWrite
pub fn to_write_unsized(&self) -> BufWrite
Convert to an unsized BufWrite instance without cloning internal data and without changing memory locking strategy.
sourcepub fn try_unwrap(self) -> Result<Box<[u8], Global>, BufRead>
pub fn try_unwrap(self) -> Result<Box<[u8], Global>, 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.
sourcepub fn try_unwrap_sized(self) -> Result<[u8; N], BufReadSized<N>>
pub fn try_unwrap_sized(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.
Trait Implementations§
source§impl<const N: usize> Clone for BufWriteSized<N>
impl<const N: usize> Clone for BufWriteSized<N>
source§fn clone(&self) -> BufWriteSized<N>
fn clone(&self) -> BufWriteSized<N>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<const N: usize> Debug for BufWriteSized<N>
impl<const N: usize> Debug for BufWriteSized<N>
source§impl<const N: usize> From<BufWriteSized<N>> for BufExtend
impl<const N: usize> From<BufWriteSized<N>> for BufExtend
source§fn from(b: BufWriteSized<N>) -> BufExtend
fn from(b: BufWriteSized<N>) -> BufExtend
source§impl<const S: usize> From<BufWriteSized<S>> for BufRead
impl<const S: usize> From<BufWriteSized<S>> for BufRead
source§fn from(b: BufWriteSized<S>) -> BufRead
fn from(b: BufWriteSized<S>) -> BufRead
source§impl<const S: usize> From<BufWriteSized<S>> for BufReadSized<S>
impl<const S: usize> From<BufWriteSized<S>> for BufReadSized<S>
source§fn from(b: BufWriteSized<S>) -> BufReadSized<S>
fn from(b: BufWriteSized<S>) -> BufReadSized<S>
Auto Trait Implementations§
impl<const N: usize> !RefUnwindSafe for BufWriteSized<N>
impl<const N: usize> Send for BufWriteSized<N>
impl<const N: usize> Sync for BufWriteSized<N>
impl<const N: usize> Unpin for BufWriteSized<N>
impl<const N: usize> !UnwindSafe for BufWriteSized<N>
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
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
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> 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> ⓘ
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.