Struct librsnek::api::selfref::RefCount
[−]
[src]
pub struct RefCount(pub RefCell<Option<WeakRtObject>>);
RefCount struct that holds a mutable and optional weakref
Trait Implementations
impl Clone for RefCount
[src]
fn clone(&self) -> Self
Returns a copy of the value.
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
.
impl SelfRef for RefCount
[src]
fn strong_count(&self) -> Integer
Unwrap the optional type and proxy to the underlying WeakRtObject if present
fn weak_count(&self) -> Integer
Unwrap the optional type and proxy to the underlying WeakRtObject if present
fn set(&self, selfref: &RtObject)
Set the SelfRef
from strong RtObject
by cloning and downgrading that
fn get(&self) -> WeakRtObject
Return a clone of of the backing WeakRtObject
fn upgrade(&self) -> Result<RtObject, Error>
Take the WeakRtObject
backing the SelfRef
and attempt to upgrade it
impl Debug for RefCount
[src]
Display the strong and weak reference counts
impl Default for RefCount
[src]
Default to an inner cell value of None meaning that the selfref has not been set
fn default() -> Self
Returns the "default value" for a type.