Struct objc2::rc::WeakId[][src]

#[repr(transparent)]
pub struct WeakId<T: ?Sized> { /* fields omitted */ }
Expand description

A pointer type for a weak reference to an Objective-C reference counted object.

Allows breaking reference cycles and safely checking whether the object has been deallocated.

Implementations

Construct a new WeakId referencing the given shared Id.

Load a shared (and retained) Id if the object still exists.

Returns None if the object has been deallocated or was created with Default::default.

Trait Implementations

Makes a clone of the WeakId that points to the same object.

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Constructs a new WeakId<T> that doesn’t reference any object.

Calling Self::load on the return value always gives None.

Drops the WeakId pointer.

This implementation follows the same reasoning as Id<T, Shared>.

This implementation follows the same reasoning as Id<T, Shared>.

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.