#[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.
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
.
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>
.
impl<T> Any for T where
T: 'static + ?Sized,
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T, U> Into<U> for T where
U: From<T>,
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.
The type returned in the event of a conversion error.