[][src]Struct vtable::VWeak

#[repr(transparent)]pub struct VWeak<VTable: VTableMetaDropInPlace + 'static, X = Dyn> { /* fields omitted */ }

Weak pointer for the VRc where VTable is a VTable struct, and X is the type of the instance, or Dyn if it is not known

Similar to std::rc::Weak.

Can be constructed with VRc::downgrade and use VWeak::upgrade to re-create the original VRc.

Implementations

impl<VTable: VTableMetaDropInPlace + 'static, X> VWeak<VTable, X>[src]

pub fn upgrade(&self) -> Option<VRc<VTable, X>>[src]

Returns a new VRc if some other instance still holds a strong reference to this item. Otherwise, returns None.

impl<VTable: VTableMetaDropInPlace + 'static, X: HasStaticVTable<VTable> + 'static> VWeak<VTable, X>[src]

pub fn into_dyn(self) -> VWeak<VTable, Dyn>[src]

Convert a VRc of a real instance to a VRc of a Dyn instance

Trait Implementations

impl<VTable: VTableMetaDropInPlace + 'static, X> Clone for VWeak<VTable, X>[src]

impl<VTable: VTableMetaDropInPlace + 'static, X> Default for VWeak<VTable, X>[src]

impl<T: VTableMetaDropInPlace + 'static, X> Drop for VWeak<T, X>[src]

Auto Trait Implementations

impl<VTable, X = Dyn> !RefUnwindSafe for VWeak<VTable, X>

impl<VTable, X = Dyn> !Send for VWeak<VTable, X>

impl<VTable, X = Dyn> !Sync for VWeak<VTable, X>

impl<VTable, X> Unpin for VWeak<VTable, X>

impl<VTable, X = Dyn> !UnwindSafe for VWeak<VTable, X>

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.