[][src]Struct reffers::arc::Weak

pub struct Weak<T: ?Sized + Repr, M: BitMask<Num = usize> = usize>(_);

A weak reference without access to the inner value.

To get immutable/mutable access, you need to use the get_ref/get_refmut functions to create Ref or RefMut references.

If only weak references exist to the inner value, the inner value will be dropped, and can no longer be accessed.

Methods

impl<T: ?Sized + Repr, M: BitMask<Num = usize>> Weak<T, M>[src]

pub fn get_mut(&self) -> RefMut<T, M>[src]

Deprecated:

Renamed to get_refmut

Returns a new RefMut, or panics if this is not possible

Will panic in case a RefMut or Ref is currently held

pub fn try_get_mut(&self) -> Result<RefMut<T, M>, State>[src]

Deprecated:

Renamed to try_get_refmut

Returns a new RefMut, or panics if this is not possible

Will return an error in case a RefMut or Ref is currently held

pub fn get_refmut(&self) -> RefMut<T, M>[src]

Returns a new RefMut, or panics if this is not possible

Will panic in case a RefMut or Ref is currently held

pub fn try_get_refmut(&self) -> Result<RefMut<T, M>, State>[src]

Returns a new RefMut, or panics if this is not possible

Will return an error in case a RefMut or Ref is currently held

pub fn get_ref(&self) -> Ref<T, M>[src]

Returns a new Ref, or panics if this is not possible

Will panic in case a RefMut is currently held, or there are no more Refs available

pub fn try_get_ref(&self) -> Result<Ref<T, M>, State>[src]

Returns a new Ref, or returns an error if there are no such references available

Will return an error in case a RefMut is currently held, or there are no more Refs available

pub fn get(&self) -> Ref<T, M>[src]

Deprecated:

Renamed to get_ref

Returns a new Ref, or panics if this is not possible

Will panic in case a RefMut is currently held, or there are no more Refs available

pub fn try_get(&self) -> Result<Ref<T, M>, State>[src]

Deprecated:

Renamed to try_get_ref

Returns a new Ref, or returns an error if there are no such references available

Will return an error in case a RefMut is currently held, or there are no more Refs available

pub fn get_weak(&self) -> Weak<T, M>[src]

Returns a new Weak reference, or panics if there are no such references available

pub fn get_strong(&self) -> Strong<T, M>[src]

Returns a new Strong reference, or panics if there are no such references available

pub fn try_get_weak(&self) -> Result<Weak<T, M>, State>[src]

Returns a new Weak reference, or returns an error if there are no such references available

pub fn try_get_strong(&self) -> Result<Strong<T, M>, State>[src]

Returns a new Strong reference, or returns an error if there are no such references available

pub fn state(&self) -> State[src]

Returns the current state

pub fn unpoison(&self) -> Result<(), State>[src]

Reverts poisoning

Poisoning happens when a RefMut is dropped during a panic.

Trait Implementations

impl<T: Send, M: Send + BitMask<Num = usize>> Send for Weak<T, M>[src]

impl<T: Send, M: Send + BitMask<Num = usize>> Sync for Weak<T, M>[src]

impl<T: ?Sized + Repr, M: BitMask<Num = usize>> Drop for Weak<T, M>[src]

impl<T: ?Sized + Repr, M: BitMask<Num = usize>> Clone for Weak<T, M>[src]

impl<T: Debug + ?Sized + Repr, M: Debug + BitMask<Num = usize>> Debug for Weak<T, M>[src]

Auto Trait Implementations

impl<T: ?Sized, M> Unpin for Weak<T, M> where
    <T as Repr>::Store: Unpin

impl<T, M = usize> !UnwindSafe for Weak<T, M>

impl<T, M = usize> !RefUnwindSafe for Weak<T, M>

Blanket Implementations

impl<T> Repr for T[src]

type Store = T

impl<T> Repr for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]