[][src]Struct reffers::rc::Strong

pub struct Strong<T: ?Sized + Repr, M: BitMask = u32>(_, _);

A strong 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.

The inner value cannot be dropped while Strong, Ref or RefMut references exist.

Methods

impl<T, M: BitMask> Strong<T, M>[src]

pub fn new(t: T) -> Self[src]

Creates a new reference.

impl<M: BitMask> Strong<str, M>[src]

pub fn new_str(t: &str) -> Self[src]

Creates a new reference from a str.

impl<T, M: BitMask> Strong<[T], M>[src]

pub fn new_slice<I: ExactSizeIterator<Item = T>>(t: I) -> Self[src]

Creates a new slice reference from an iterator.

impl<T: ?Sized + Repr, M: BitMask> Strong<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: ?Sized + Repr, M: BitMask> Drop for Strong<T, M>[src]

impl<T, M: BitMask> From<T> for Strong<T, M>[src]

impl<T: ?Sized + Repr, M: BitMask> Clone for Strong<T, M>[src]

impl<T: Default, M: BitMask> Default for Strong<T, M>[src]

impl<T: Debug + ?Sized + Repr, M: Debug + BitMask> Debug for Strong<T, M> where
    T::Store: Debug
[src]

Auto Trait Implementations

impl<T, M = u32> !Send for Strong<T, M>

impl<T, M = u32> !Sync for Strong<T, M>

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

impl<T, M = u32> !UnwindSafe for Strong<T, M>

impl<T, M = u32> !RefUnwindSafe for Strong<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> From<!> 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]