Trait fruity__bbqsrc::core::ObjectType [−][src]
pub trait ObjectType: Sized { fn retain(obj: &Self) -> Arc<Self>; unsafe fn release(obj: NonNull<Self>); }
Expand description
An object from some runtime.
All objects have a lifetime tied to a retain count.
This is implemented using different functions for each runtime:
-
Objective-C:
objc_retain
andobjc_release
-
Core Foundation:
CFRetain
andCFRelease
-
libdispatch (a.k.a. Grand Central Dispatch):
dispatch_retain
anddispatch_release
Related Items
Required methods
Increments the object’s retain count and returns a smart pointer that
automatically calls release
on
Drop
.
To avoid releasing on Drop
, call std::mem::forget
on the result.