pub struct SmartPointerSendable<T: Clone> { /* private fields */ }Expand description
Most of the time, this smart pointer will need to be the last field of a struct to ensure proper drop order.
Implementations§
Source§impl<T: Clone> SmartPointerSendable<T>
impl<T: Clone> SmartPointerSendable<T>
pub fn new(ptr: T, drop_guard: Arc<dyn ObsDropGuard>) -> Self
pub fn get_ptr(&self) -> T
pub fn into_comp(self) -> SmartPointerSendableComp<T>
Sourcepub unsafe fn drop_guard(&self) -> Arc<dyn ObsDropGuard>
pub unsafe fn drop_guard(&self) -> Arc<dyn ObsDropGuard>
§Safety
This exposes the drop guard, which may lead to misuse. Make sure to only use it when you need it.
Trait Implementations§
Source§impl<T: Clone + Clone> Clone for SmartPointerSendable<T>
impl<T: Clone + Clone> Clone for SmartPointerSendable<T>
Source§fn clone(&self) -> SmartPointerSendable<T>
fn clone(&self) -> SmartPointerSendable<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<T: Clone> Send for SmartPointerSendable<T>
Available on crate feature
enable_runtime only.impl<T: Clone> Sync for SmartPointerSendable<T>
Available on crate feature
enable_runtime only.Auto Trait Implementations§
impl<T> Freeze for SmartPointerSendable<T>where
T: Freeze,
impl<T> !RefUnwindSafe for SmartPointerSendable<T>
impl<T> Unpin for SmartPointerSendable<T>where
T: Unpin,
impl<T> !UnwindSafe for SmartPointerSendable<T>
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