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§
sourcetype Upgrade: Var<T>
type Upgrade: Var<T>
Output of WeakVar::upgrade
.
Required Methods§
sourcefn upgrade(&self) -> Option<Self::Upgrade>
fn upgrade(&self) -> Option<Self::Upgrade>
Upgrade to a strong BoxedVar<T>
clone.
Returns None
if the strong_count
is zero.
Provided Methods§
sourcefn boxed(self) -> BoxedWeakVar<T>where
Self: Sized,
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.