[−][src]Struct reffers::rc::Weak
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> Weak<T, M>
[src]
pub fn get_mut(&self) -> RefMut<T, M>
[src]
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]
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]
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]
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 Weak<T, M>
[src]
impl<T: ?Sized + Repr, M: BitMask> Clone for Weak<T, M>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl<T, M = u32> !Send for Weak<T, M>
impl<T, M = u32> !Sync for Weak<T, M>
impl<T: ?Sized, M> Unpin for Weak<T, M> where
T: Unpin,
T: Unpin,
impl<T, M = u32> !UnwindSafe for Weak<T, M>
impl<T, M = u32> !RefUnwindSafe for Weak<T, M>
Blanket Implementations
impl<T> Repr for T
[src]
type Store = T
fn convert(*mut T) -> *mut T
[src]
unsafe fn deallocate_mem<M>(&mut UnsafeCell<RCell<<T as Repr>::Store, M>>) where
M: BitMask,
[src]
M: BitMask,
impl<T> Repr for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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> 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,