pub struct SyncPointer<T: ?Sized> { /* private fields */ }Expand description
A dynamic threadsafe smart pointer.
A SyncPointer implements Send and Sync, which means the smart pointer it wraps must be Send and Sync (if the data it owns is, that is). For this reason, an Rc cannot be made into a SyncPointer.
Implementations§
Source§impl<T> SyncPointer<T>
impl<T> SyncPointer<T>
Sourcepub fn new(data: T) -> SyncPointer<T>
pub fn new(data: T) -> SyncPointer<T>
Construct a new SyncPointer directly.
Trait Implementations§
Source§impl<T: ?Sized> Clone for SyncPointer<T>
impl<T: ?Sized> Clone for SyncPointer<T>
Source§fn clone(&self) -> SyncPointer<T>
fn clone(&self) -> SyncPointer<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 moreSource§impl<T: ?Sized> Deref for SyncPointer<T>
impl<T: ?Sized> Deref for SyncPointer<T>
Source§impl<T: ?Sized> From<&'static T> for SyncPointer<T>
impl<T: ?Sized> From<&'static T> for SyncPointer<T>
Source§fn from(ptr: &'static T) -> SyncPointer<T>
fn from(ptr: &'static T) -> SyncPointer<T>
Converts to this type from the input type.
Source§impl<T: ?Sized> From<Arc<T>> for SyncPointer<T>
impl<T: ?Sized> From<Arc<T>> for SyncPointer<T>
Source§fn from(ptr: Arc<T>) -> SyncPointer<T>
fn from(ptr: Arc<T>) -> SyncPointer<T>
Converts to this type from the input type.
Source§fn from(ptr: SharedPointer<T>) -> SyncPointer<T>
fn from(ptr: SharedPointer<T>) -> SyncPointer<T>
Converts to this type from the input type.
Source§fn from(ptr: SyncPointer<T>) -> SharedPointer<T>
fn from(ptr: SyncPointer<T>) -> SharedPointer<T>
Converts to this type from the input type.
impl<T: Send + Sync + ?Sized> Send for SyncPointer<T>
impl<T: Send + Sync + ?Sized> Sync for SyncPointer<T>
Auto Trait Implementations§
impl<T> Freeze for SyncPointer<T>where
T: ?Sized,
impl<T> RefUnwindSafe for SyncPointer<T>where
T: RefUnwindSafe + ?Sized,
impl<T> Unpin for SyncPointer<T>where
T: ?Sized,
impl<T> UnwindSafe for SyncPointer<T>where
T: RefUnwindSafe + ?Sized,
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