Struct type_handle::RCHandle
source · #[repr(transparent)]pub struct RCHandle<T>(_);
Expand description
A wrapper type represented by a reference counted pointer to the wrapped type.
Implementations§
source§impl<T> RCHandle<T>
impl<T> RCHandle<T>
sourcepub fn from_ptr(ptr: *mut T) -> Option<Self>
pub fn from_ptr(ptr: *mut T) -> Option<Self>
Create a reference counted handle from a pointer.
Takes ownership of the object the pointer points to, does not increase the reference count.
Returns None
if the pointer is null
.
Create a reference counted handle from a pointer.
Shares ownership with the object the pointer points to, therefore increases the reference count.
Returns None
if the pointer is null
.
Create a reference to the wrapper from a reference to a pointer that points to the wrapped type.
Trait Implementations§
source§impl<T: PartialEq> PartialEq<RCHandle<T>> for RCHandle<T>
impl<T: PartialEq> PartialEq<RCHandle<T>> for RCHandle<T>
impl<T> Send for RCHandle<T>
impl<T> Sync for RCHandle<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for RCHandle<T>where T: RefUnwindSafe,
impl<T> Unpin for RCHandle<T>
impl<T> UnwindSafe for RCHandle<T>where T: RefUnwindSafe,
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