[][src]Struct kul::datum::DatumRc

pub struct DatumRc<TT, ET>(pub Rc<RcDatum<TT, ET>>);

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]

pub fn new(val: RcDatum<TT, ET>) -> Self[src]

Make an Rced Datum with value from the given argument.

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

impl<TT, ET> RcLike for DatumRc<TT, ET>[src]

type RC = Rc<RcDatum<TT, ET>>

The underlying Rc-like type

fn try_replace(
    this: &mut Self,
    val: Self::Target
) -> Result<Self::Target, Self::Target>
[src]

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]

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]

impl<TT: Clone, ET: Clone> Clone for 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_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

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.

impl<TT, ET> DerefTryMut for DatumRc<TT, ET>[src]

This allows Rc to be used as the Datum reference type.

Auto Trait Implementations

impl<TT, ET> !Send for DatumRc<TT, ET>

impl<TT, ET> !Sync for DatumRc<TT, ET>

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]