Struct mutringbuf::UnsafeSyncCell
source · pub struct UnsafeSyncCell<T>(/* private fields */);
Expand description
Sync version of UnsafeCell<MaybeUninit<T>>
.
While it should not be used outside of this crate, it might result useful in certain cases.
Implementations§
source§impl<T> UnsafeSyncCell<T>
impl<T> UnsafeSyncCell<T>
sourcepub fn check_zeroed(ptr: *const T) -> bool
pub fn check_zeroed(ptr: *const T) -> bool
Checks whether the memory pointed by ptr
, for a certain type T, is only composed of zeros.
sourcepub unsafe fn inner_ref_mut<'a>(&self) -> &'a mut T
pub unsafe fn inner_ref_mut<'a>(&self) -> &'a mut T
Returns a mutable reference to inner value.
§Safety
Not to be used to initialise inner value! Use Self::as_mut_ptr
, instead.
sourcepub fn as_mut_ptr(&self) -> *mut T
pub fn as_mut_ptr(&self) -> *mut T
Gets a mutable pointer to the contained value.
See MaybeUninit::as_mut_ptr
.
Trait Implementations§
source§impl<T: Default> Default for UnsafeSyncCell<T>
impl<T: Default> Default for UnsafeSyncCell<T>
source§fn default() -> UnsafeSyncCell<T>
fn default() -> UnsafeSyncCell<T>
Creates an UnsafeSyncCell
, with the Default
value for T.
source§impl<T> Drop for UnsafeSyncCell<T>
impl<T> Drop for UnsafeSyncCell<T>
source§impl<T> From<T> for UnsafeSyncCell<T>
impl<T> From<T> for UnsafeSyncCell<T>
source§fn from(t: T) -> UnsafeSyncCell<T>
fn from(t: T) -> UnsafeSyncCell<T>
Creates a new UnsafeSyncCell<T>
containing the given value.
impl<T: Sync> Sync for UnsafeSyncCell<T>
Auto Trait Implementations§
impl<T> !Freeze for UnsafeSyncCell<T>
impl<T> !RefUnwindSafe for UnsafeSyncCell<T>
impl<T> Send for UnsafeSyncCell<T>where
T: Send,
impl<T> Unpin for UnsafeSyncCell<T>where
T: Unpin,
impl<T> UnwindSafe for UnsafeSyncCell<T>where
T: UnwindSafe,
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