Struct sync_ptr::SendMutPtr
source · pub struct SendMutPtr<T>(/* private fields */);Expand description
Wrapped mutable raw pointer that is Send but not Sync
Implementations§
source§impl<T> SendMutPtr<T>
impl<T> SendMutPtr<T>
sourcepub const unsafe fn new(ptr: *mut T) -> Self
pub const unsafe fn new(ptr: *mut T) -> Self
Makes ptr Send
§Safety
The ptr parameter must be able to handle being sent to other threads
or special care must be taken when using the wrapped ptr to not use it
in any way in other threads.
sourcepub const fn cast<Y>(&self) -> SendMutPtr<Y>
pub const fn cast<Y>(&self) -> SendMutPtr<Y>
Casts ptr to another data type while keeping it Send.
sourcepub const unsafe fn as_sync_const(&self) -> SyncConstPtr<T>
pub const unsafe fn as_sync_const(&self) -> SyncConstPtr<T>
Makes this ptr Sync
§Safety
This ptr must be able to handle being accessed by multiple threads at the same time,
or special care must be taken when using the wrapped ptr to not use it
in any way in other threads.
sourcepub const fn as_send_const(&self) -> SendConstPtr<T>
pub const fn as_send_const(&self) -> SendConstPtr<T>
Makes this ptr const.
sourcepub const unsafe fn as_sync_mut(&self) -> SyncMutPtr<T>
pub const unsafe fn as_sync_mut(&self) -> SyncMutPtr<T>
Makes this ptr Sync
§Safety
This ptr must be able to handle being accessed by multiple threads at the same time,
or special care must be taken when using the wrapped ptr to not use it
in any way in other threads.
sourcepub const fn as_send_mut(&self) -> SendMutPtr<T>
pub const fn as_send_mut(&self) -> SendMutPtr<T>
This is equivalent to .clone() and does nothing.
Trait Implementations§
source§impl<T> Clone for SendMutPtr<T>
impl<T> Clone for SendMutPtr<T>
source§impl<T: Debug> Debug for SendMutPtr<T>
impl<T: Debug> Debug for SendMutPtr<T>
source§impl<T> Deref for SendMutPtr<T>
impl<T> Deref for SendMutPtr<T>
source§impl<T: Hash> Hash for SendMutPtr<T>
impl<T: Hash> Hash for SendMutPtr<T>
source§impl<T> Into<*const T> for SendMutPtr<T>
impl<T> Into<*const T> for SendMutPtr<T>
source§impl<T> Into<*mut T> for SendMutPtr<T>
impl<T> Into<*mut T> for SendMutPtr<T>
source§impl<T: Ord> Ord for SendMutPtr<T>
impl<T: Ord> Ord for SendMutPtr<T>
source§fn cmp(&self, other: &SendMutPtr<T>) -> Ordering
fn cmp(&self, other: &SendMutPtr<T>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl<T: PartialEq> PartialEq for SendMutPtr<T>
impl<T: PartialEq> PartialEq for SendMutPtr<T>
source§impl<T: PartialOrd> PartialOrd for SendMutPtr<T>
impl<T: PartialOrd> PartialOrd for SendMutPtr<T>
impl<T> Copy for SendMutPtr<T>
impl<T: Eq> Eq for SendMutPtr<T>
impl<T> Send for SendMutPtr<T>
impl<T> StructuralPartialEq for SendMutPtr<T>
Auto Trait Implementations§
impl<T> Freeze for SendMutPtr<T>
impl<T> RefUnwindSafe for SendMutPtr<T>where
T: RefUnwindSafe,
impl<T> !Sync for SendMutPtr<T>
impl<T> Unpin for SendMutPtr<T>
impl<T> UnwindSafe for SendMutPtr<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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)