[][src]Struct crndm::prc::VWeak

pub struct VWeak<T: ?Sized, A: MemPool> { /* fields omitted */ }

VWeak is a version of Prc that holds a non-owning reference to the managed allocation in the volatile heap. The allocation is accessed by calling upgrade on the VWeak pointer, which returns an Option<Prc<T>>.

Since a VWeak reference does not count towards ownership, it will not prevent the value stored in the allocation from being dropped, and VWeak itself makes no guarantees about the value still being present. Thus it may return None when upgraded. Note however that a VWeak reference, unlike Weak, does NOT prevent the allocation itself (the backing store) from being deallocated.

A VWeak pointer is useful for keeping a temporary reference to the persistent allocation managed by Prc without preventing its inner value from being dropped from ... It is also used to prevent circular references between Prc pointers, since mutual owning references would never allow either Prc to be dropped. For example, a tree could have strong Prc pointers from parent nodes to children, and Weak pointers from children back to their parents.

The typical way to obtain a VWeak pointer is to call Prc::volatile.

Implementations

impl<T: PSafe + ?Sized, A: MemPool> VWeak<T, A>[src]

pub fn null() -> VWeak<T, A> where
    T: Sized
[src]

pub fn upgrade(&self, journal: &Journal<A>) -> Option<Prc<T, A>>[src]

Trait Implementations

impl<T: PSafe + ?Sized, A: MemPool> Clone for VWeak<T, A>[src]

impl<T: ?Sized, A: MemPool> Drop for VWeak<T, A>[src]

impl<T: ?Sized, A: MemPool> PSafe for VWeak<T, A>[src]

impl<T: ?Sized, A: MemPool> RefUnwindSafe for VWeak<T, A>[src]

impl<T: ?Sized, A: MemPool> !Send for VWeak<T, A>[src]

impl<T: ?Sized, A: MemPool> !Sync for VWeak<T, A>[src]

impl<T: ?Sized, A: MemPool> TxInSafe for VWeak<T, A>[src]

impl<T: ?Sized, A: MemPool> TxOutSafe for VWeak<T, A>[src]

impl<T: ?Sized, A: MemPool> UnwindSafe for VWeak<T, A>[src]

Auto Trait Implementations

impl<T: ?Sized, A> LooseTxInUnsafe for VWeak<T, A> where
    A: LooseTxInUnsafe,
    T: LooseTxInUnsafe
[src]

impl<T: ?Sized, A> Unpin for VWeak<T, A>[src]

impl<T, A> !VSafe for VWeak<T, A>[src]

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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<V, T> VZip<V> for T where
    V: MultiLane<T>,