zng_var

Trait WeakVar

source
pub trait WeakVar<T: VarValue>: AnyWeakVar + Clone {
    type Upgrade: Var<T>;

    // Required method
    fn upgrade(&self) -> Option<Self::Upgrade>;

    // Provided method
    fn boxed(self) -> BoxedWeakVar<T>
       where Self: Sized { ... }
}
Expand description

Represents a weak reference to a Var<T>.

Required Associated Types§

source

type Upgrade: Var<T>

Output of WeakVar::upgrade.

Required Methods§

source

fn upgrade(&self) -> Option<Self::Upgrade>

Upgrade to a strong BoxedVar<T> clone.

Returns None if the strong_count is zero.

Provided Methods§

source

fn boxed(self) -> BoxedWeakVar<T>
where Self: Sized,

Gets the weak reference a as BoxedWeakVar<T>, does not double box.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<I: VarValue, O: VarValue, S: WeakVar<I>> WeakVar<O> for WeakMapRef<I, O, S>

source§

type Upgrade = MapRef<I, O, <S as WeakVar<I>>::Upgrade>

source§

impl<I: VarValue, O: VarValue, S: WeakVar<I>> WeakVar<O> for WeakMapRefBidi<I, O, S>

source§

type Upgrade = MapRefBidi<I, O, <S as WeakVar<I>>::Upgrade>

source§

impl<T, V> WeakVar<T> for WeakFlatMapVar<T, V>
where T: VarValue, V: Var<T>,

source§

impl<T: VarValue> WeakVar<T> for WeakArcVar<T>

source§

impl<T: VarValue> WeakVar<T> for WeakContextualizedVar<T>

source§

impl<T: VarValue> WeakVar<T> for WeakMergeVar<T>

source§

impl<T: VarValue> WeakVar<T> for WeakWhenVar<T>

source§

impl<T: VarValue> WeakVar<T> for BoxedWeakVar<T>

source§

type Upgrade = Box<dyn VarBoxed<T>>

source§

impl<T: VarValue, S: Var<T>> WeakVar<T> for WeakCowVar<T, S>

source§

impl<T: VarValue, V: WeakVar<T>> WeakVar<T> for WeakReadOnlyVar<T, V>

source§

type Upgrade = <<V as WeakVar<T>>::Upgrade as Var<T>>::ReadOnly