Trait zng::var::AnyWeakVar
source · pub trait AnyWeakVar:
Any
+ Send
+ Sync
+ Sealed {
// Required methods
fn clone_any(&self) -> Box<dyn AnyWeakVar>;
fn as_any(&self) -> &(dyn Any + 'static);
fn strong_count(&self) -> usize;
fn weak_count(&self) -> usize;
fn upgrade_any(&self) -> Option<Box<dyn AnyVar>>;
}
Expand description
Represents a weak reference to an AnyVar
.
Required Methods§
sourcefn clone_any(&self) -> Box<dyn AnyWeakVar>
fn clone_any(&self) -> Box<dyn AnyWeakVar>
Clone the weak reference.
sourcefn strong_count(&self) -> usize
fn strong_count(&self) -> usize
Gets the number of strong references to the variable.
This is the same as AnyVar::strong_count
.
sourcefn weak_count(&self) -> usize
fn weak_count(&self) -> usize
Gets the number of weak references to the variable.
This is the same as AnyVar::weak_count
.
sourcefn upgrade_any(&self) -> Option<Box<dyn AnyVar>>
fn upgrade_any(&self) -> Option<Box<dyn AnyVar>>
Upgrade to a strong AnyVar
clone.
Returns None
if the strong_count
is zero.
Trait Implementations§
source§impl Clone for Box<dyn AnyWeakVar>
impl Clone for Box<dyn AnyWeakVar>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more