[−][src]Struct kul::datum::DatumRc
This wrapper allows the needed recursive type definition for Rc
to be used
as the Datum
reference type.
Methods
impl<TT, ET> DatumRc<TT, ET>
[src]
Trait Implementations
impl<TT, ET> Algo1DatumRef for DatumRc<TT, ET>
[src]
This allows using the custom drop algorithm, and it allows the algorithm to
restructure tree nodes that have other weak references to them (which isn't
possible with DerefTryMut::get_mut
alone).
fn try_replace(
this: &mut Self,
val: Self::Target
) -> Result<Self::Target, Self::Target>
[src]
this: &mut Self,
val: Self::Target
) -> Result<Self::Target, Self::Target>
fn set(this: &mut Self, val: Self::Target)
[src]
impl<TT, ET> RcLike for DatumRc<TT, ET>
[src]
type RC = Rc<RcDatum<TT, ET>>
The underlying Rc
-like type
fn get_rc(this: &mut Self) -> &mut Self::RC
[src]
fn new_rc(val: Self::Target) -> Self::RC
[src]
fn try_unwrap(rc: Self::RC) -> Result<Self::Target, Self::RC>
[src]
fn try_replace(
this: &mut Self,
val: Self::Target
) -> Result<Self::Target, Self::Target>
[src]
this: &mut Self,
val: Self::Target
) -> Result<Self::Target, Self::Target>
Implementation of Algo1DatumRef::try_replace
for generic Rc
-like types. The default implementation uses try_unwrap
and heap allocation which is inefficient. Read more
fn set(this: &mut Self, val: Self::Target)
[src]
Implementation of Algo1DatumRef::set
for generic Rc
-like types. The default implementation uses DerefTryMut
and is safe to call after a success-return from Algo1DatumRef::try_replace
. Read more
impl<TT, ET> RcLikeAtomicCounts for DatumRc<TT, ET>
[src]
fn counts(this: &Self) -> (usize, usize)
[src]
This is atomic enough to meet the requirements, because Rc
is
single-threaded.
fn try_replace_optim(
this: &mut Self,
val: Self::Target
) -> Result<Self::Target, Self::Target>
[src]
this: &mut Self,
val: Self::Target
) -> Result<Self::Target, Self::Target>
Optimized implementation of Algo1DatumRef::try_replace
for generic Rc
-like types that can supply both strong and weak reference counts atomically. The default implementation uses DerefTryMut
when possible to avoid the heap allocation and unwrapping that the basic default RcLike::try_replace
does. Read more
impl<TT, ET> Drop for DatumRc<TT, ET>
[src]
Use algorithm #1 for dropping, to avoid extensive drop recursion.
impl<TT: PartialEq, ET: PartialEq> PartialEq<DatumRc<TT, ET>> for DatumRc<TT, ET>
[src]
fn eq(&self, other: &DatumRc<TT, ET>) -> bool
[src]
fn ne(&self, other: &DatumRc<TT, ET>) -> bool
[src]
impl<TT: Clone, ET: Clone> Clone for DatumRc<TT, ET>
[src]
fn clone(&self) -> DatumRc<TT, ET>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<TT: Eq, ET: Eq> Eq for DatumRc<TT, ET>
[src]
impl<TT: Debug, ET: Debug> Debug for DatumRc<TT, ET>
[src]
impl<TT: Hash, ET: Hash> Hash for DatumRc<TT, ET>
[src]
fn hash<__HTTET: Hasher>(&self, state: &mut __HTTET)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<TT, ET> Deref for DatumRc<TT, ET>
[src]
Required by DerefTryMut
.
type Target = RcDatum<TT, ET>
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
impl<TT, ET> DerefTryMut for DatumRc<TT, ET>
[src]
This allows Rc
to be used as the Datum
reference type.
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,