zng::var

Trait WeakVar

source
pub trait WeakVar<T>: AnyWeakVar + Clone
where T: VarValue,
{ type Upgrade: Var<T>; // Required method fn upgrade(&self) -> Option<Self::Upgrade>; // Provided method fn boxed(self) -> Box<dyn WeakVarBoxed<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) -> Box<dyn WeakVarBoxed<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, O, S> WeakVar<O> for WeakMapRef<I, O, S>
where I: VarValue, O: VarValue, S: WeakVar<I>,

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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