Struct objc::rc::StrongPtr [−][src]
pub struct StrongPtr(_);
A pointer that strongly references an object, ensuring it won't be deallocated.
Methods
impl StrongPtr
[src]
impl StrongPtr
pub unsafe fn new(ptr: *mut Object) -> Self
[src]
pub unsafe fn new(ptr: *mut Object) -> Self
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.
pub unsafe fn retain(ptr: *mut Object) -> Self
[src]
pub unsafe fn retain(ptr: *mut Object) -> Self
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.
pub fn autorelease(self) -> *mut Object
[src]
pub fn autorelease(self) -> *mut Object
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.
pub fn weak(&self) -> WeakPtr
[src]
pub fn weak(&self) -> WeakPtr
Returns a WeakPtr
to self.
Methods from Deref<Target = *mut Object>
Trait Implementations
impl Drop for StrongPtr
[src]
impl Drop for StrongPtr
impl Clone for StrongPtr
[src]
impl Clone for StrongPtr
fn clone(&self) -> StrongPtr
[src]
fn clone(&self) -> StrongPtr
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Deref for StrongPtr
[src]
impl Deref for StrongPtr
type Target = *mut Object
The resulting type after dereferencing.
fn deref(&self) -> &*mut Object
[src]
fn deref(&self) -> &*mut Object
Dereferences the value.
impl Pointer for StrongPtr
[src]
impl Pointer for StrongPtr