pub struct AutoreleasePool(/* private fields */);Expand description
An Objective-C autorelease pool.
C++ equivalent: NS::AutoreleasePool
Implementations§
Source§impl AutoreleasePool
impl AutoreleasePool
Sourcepub fn alloc() -> Option<Self>
pub fn alloc() -> Option<Self>
Allocate a new autorelease pool.
C++ equivalent: static AutoreleasePool* alloc()
Sourcepub fn init(&self) -> Option<Self>
pub fn init(&self) -> Option<Self>
Initialize an allocated autorelease pool.
C++ equivalent: AutoreleasePool* init()
Sourcepub fn add_object(&self, object: &Object)
pub fn add_object(&self, object: &Object)
Add an object to the autorelease pool.
C++ equivalent: void addObject(Object* pObject)
Sourcepub fn show_pools()
pub fn show_pools()
Show all autorelease pools (for debugging).
C++ equivalent: static void showPools()
Trait Implementations§
Source§impl Clone for AutoreleasePool
impl Clone for AutoreleasePool
Source§fn clone(&self) -> AutoreleasePool
fn clone(&self) -> AutoreleasePool
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AutoreleasePool
impl Debug for AutoreleasePool
Source§impl Drop for AutoreleasePool
impl Drop for AutoreleasePool
Source§impl Referencing for AutoreleasePool
impl Referencing for AutoreleasePool
Source§fn as_mut_ptr(&self) -> *mut c_void
fn as_mut_ptr(&self) -> *mut c_void
Get the raw mutable pointer to the Objective-C object.
Source§fn retain(&self) -> Selfwhere
Self: Clone,
fn retain(&self) -> Selfwhere
Self: Clone,
Retain the object, incrementing its reference count. Read more
Source§fn autorelease(&self) -> Selfwhere
Self: Clone,
fn autorelease(&self) -> Selfwhere
Self: Clone,
Autorelease the object. Read more
Source§fn retain_count(&self) -> UInteger
fn retain_count(&self) -> UInteger
Get the retain count of the object. Read more
impl Send for AutoreleasePool
impl Sync for AutoreleasePool
Auto Trait Implementations§
impl Freeze for AutoreleasePool
impl RefUnwindSafe for AutoreleasePool
impl Unpin for AutoreleasePool
impl UnwindSafe for AutoreleasePool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more