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 fn from_address(addr: usize) -> Self
pub const fn from_address(addr: usize) -> Self
Returns a SendMutPtr from an arbitrary address.
This is equivalent to casting usize as *mut T
Sourcepub fn as_address(&self) -> usize
pub fn as_address(&self) -> usize
Returns the address of the pointer.
This is equivalent to casting the pointer using *mut T as usize.
§Note
Starting with rust 1.84.0, the pointer itself
has the functions addr and expose_provenance.
These functions should be used instead.
They are available via the deref trait.
This function is roughly equivalent to the expose_provenance function.
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 fn as_sync_const(&self) -> SyncConstPtr<T>
pub const fn as_sync_const(&self) -> SyncConstPtr<T>
Makes this ptr Sync
Sourcepub const fn as_send_const(&self) -> SendConstPtr<T>
pub const fn as_send_const(&self) -> SendConstPtr<T>
Makes this ptr const.
Sourcepub const fn as_sync_mut(&self) -> SyncMutPtr<T>
pub const fn as_sync_mut(&self) -> SyncMutPtr<T>
Makes this ptr Sync
Sourcepub const fn as_send_mut(&self) -> Self
pub const fn as_send_mut(&self) -> Self
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 for SendMutPtr<T>
impl<T> Debug for SendMutPtr<T>
Source§impl<T> Deref for SendMutPtr<T>
impl<T> Deref for SendMutPtr<T>
Source§impl<T> From<SendMutPtr<T>> for *const T
impl<T> From<SendMutPtr<T>> for *const T
Source§fn from(val: SendMutPtr<T>) -> Self
fn from(val: SendMutPtr<T>) -> Self
Converts to this type from the input type.
Source§impl<T> From<SendMutPtr<T>> for *mut T
impl<T> From<SendMutPtr<T>> for *mut T
Source§fn from(val: SendMutPtr<T>) -> Self
fn from(val: SendMutPtr<T>) -> Self
Converts to this type from the input type.
Source§impl<T> From<SendMutPtr<T>> for usize
impl<T> From<SendMutPtr<T>> for usize
Source§fn from(val: SendMutPtr<T>) -> Self
fn from(val: SendMutPtr<T>) -> Self
Converts to this type from the input type.
Source§impl<T> From<usize> for SendMutPtr<T>
impl<T> From<usize> for SendMutPtr<T>
Source§impl<T> Hash for SendMutPtr<T>
impl<T> Hash for SendMutPtr<T>
Source§impl<T> Ord for SendMutPtr<T>
impl<T> Ord for SendMutPtr<T>
Source§impl<T> PartialEq for SendMutPtr<T>
impl<T> PartialEq for SendMutPtr<T>
Source§impl<T> PartialOrd for SendMutPtr<T>
impl<T> PartialOrd for SendMutPtr<T>
Source§impl<T> Pointer for SendMutPtr<T>
impl<T> Pointer for SendMutPtr<T>
impl<T> Copy for SendMutPtr<T>
impl<T> Eq for SendMutPtr<T>
impl<T> Send 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
Mutably borrows from an owned value. Read more