Struct reffers::rc::Weak

source · []
pub struct Weak<T: ?Sized + Repr, M: BitMask = u32>(_);
Expand description

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.

Implementations

👎 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

👎 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

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

Will panic in case a RefMut or Ref is currently held

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

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

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

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

👎 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

👎 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

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

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

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

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

Returns the current state

Reverts poisoning

Poisoning happens when a RefMut is dropped during a panic.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.