pub struct StrongPtr(_);
Expand description

A pointer that strongly references an object, ensuring it won’t be deallocated.

Implementations

Constructs a StrongPtr to a newly created object that already has a +1 retain count. This will not retain the object. When dropped, the object will be released. Unsafe because the caller must ensure the given object pointer is valid.

Retains the given object and constructs a StrongPtr to it. When dropped, the object will be released. Unsafe because the caller must ensure the given object pointer is valid.

Autoreleases self, meaning that the object is not immediately released, but will be when the autorelease pool is drained. A pointer to the object is returned, but its validity is no longer ensured.

Returns a WeakPtr to self.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
The resulting type after dereferencing.
Dereferences the value.
Executes the destructor for this type. Read more
Formats the value using the given formatter.

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

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.