[−][src]Struct bacon_rajan_cc::Weak
A weak version of Cc<T>
.
Weak references do not count when determining if the inner value should be dropped.
See the module level documentation for more.
Methods
impl<T: Trace> Weak<T>
[src]
pub fn upgrade(&self) -> Option<Cc<T>>
[src]
Upgrades a weak reference to a strong reference.
Upgrades the Weak<T>
reference to an Cc<T>
, if possible.
Returns None
if there were no strong references and the data was
destroyed.
Examples
use bacon_rajan_cc::Cc; let five = Cc::new(5); let weak_five = five.downgrade(); let strong_five: Option<Cc<_>> = weak_five.upgrade();
Trait Implementations
impl<T: Trace> Trace for Weak<T>
[src]
impl<T: Trace> Clone for Weak<T>
[src]
fn clone(&self) -> Weak<T>
[src]
Makes a clone of the Weak<T>
.
This increases the weak reference count.
Examples
use bacon_rajan_cc::Cc; let weak_five = Cc::new(5).downgrade(); weak_five.clone();
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: Trace> Drop for Weak<T>
[src]
fn drop(&mut self)
[src]
Drops the Weak<T>
.
This will decrement the weak reference count.
Examples
use bacon_rajan_cc::Cc; { let five = Cc::new(5); let weak_five = five.downgrade(); // stuff drop(weak_five); // explicit drop } { let five = Cc::new(5); let weak_five = five.downgrade(); // stuff } // implicit drop
impl<T: Debug + Trace> Debug for Weak<T>
[src]
Auto Trait Implementations
impl<T> Unpin for Weak<T> where
T: Unpin,
T: Unpin,
impl<T> !Sync for Weak<T>
impl<T> !Send for Weak<T>
impl<T> !UnwindSafe for Weak<T>
impl<T> !RefUnwindSafe for Weak<T>
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,