Trait zng_var::AnyWeakVar

source ·
pub trait AnyWeakVar:
    Any
    + Send
    + Sync
    + Sealed {
    // Required methods
    fn clone_any(&self) -> BoxedAnyWeakVar;
    fn as_any(&self) -> &dyn Any;
    fn strong_count(&self) -> usize;
    fn weak_count(&self) -> usize;
    fn upgrade_any(&self) -> Option<BoxedAnyVar>;
}
Expand description

Represents a weak reference to an AnyVar.

Required Methods§

source

fn clone_any(&self) -> BoxedAnyWeakVar

Clone the weak reference.

source

fn as_any(&self) -> &dyn Any

Access to dyn Any methods.

source

fn strong_count(&self) -> usize

Gets the number of strong references to the variable.

This is the same as AnyVar::strong_count.

source

fn weak_count(&self) -> usize

Gets the number of weak references to the variable.

This is the same as AnyVar::weak_count.

source

fn upgrade_any(&self) -> Option<BoxedAnyVar>

Upgrade to a strong AnyVar clone.

Returns None if the strong_count is zero.

Implementors§