pub struct AutoReleasePool(pub Id<Object>);
Expand description

A wrapper around NSAutoReleasePool. The core App structures create and manage one of these, but it’s conceivable that users might need to create their own.

When this is dropped, we automatically send a drain message to the underlying pool. You can also call drain() yourself if you need to drain for whatever reason.

Tuple Fields

0: Id<Object>

Implementations

Creates and returns a new AutoReleasePool. You need to take care to keep this alive for as long as you need it.

Drains the underlying AutoreleasePool.

Run a function with a one-off AutoReleasePool.

This will create a custom NSAutoreleasePool, run your handler, and automatically drain when done. This is (roughly, ish) equivalent to @autoreleasepool {} under ARC. If you need to perform Cocoa calls on a different thread, it’s important to ensure they’re backed with an autorelease pool - otherwise your memory footprint will continue to grow.

Trait Implementations

Formats the value using the given formatter. Read more

Drains the underlying NSAutoreleasePool.

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 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.