Struct objc::rc::WeakPtr [−][src]
pub struct WeakPtr(_);
A pointer that weakly references an object, allowing to safely check whether it has been deallocated.
Methods
impl WeakPtr
[src]
impl WeakPtr
pub unsafe fn new(obj: *mut Object) -> Self
[src]
pub unsafe fn new(obj: *mut Object) -> Self
Constructs a WeakPtr
to the given object.
Unsafe because the caller must ensure the given object pointer is valid.
pub fn load(&self) -> StrongPtr
[src]
pub fn load(&self) -> StrongPtr
Loads the object self points to, returning a StrongPtr
.
If the object has been deallocated, the returned pointer will be null.