#[repr(transparent)]
pub struct WeakId<T: ?Sized> { /* private fields */ }
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.

Converts to this type from the input type.

The type returned in the event of a conversion error.

Performs the conversion.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

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

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.