Struct makepad_objc_sys::rc::StrongPtr
source · [−]pub struct StrongPtr(_);
Expand description
A pointer that strongly references an object, ensuring it won’t be deallocated.
Implementations
sourceimpl StrongPtr
impl StrongPtr
sourcepub unsafe fn new(ptr: *mut Object) -> Self
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.
sourcepub unsafe fn retain(ptr: *mut Object) -> Self
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.
sourcepub fn autorelease(self) -> *mut Object
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.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for StrongPtr
impl !Send for StrongPtr
impl !Sync for StrongPtr
impl Unpin for StrongPtr
impl UnwindSafe for StrongPtr
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more