pub struct RawMutex { /* private fields */ }
Implementations§
Source§impl RawMutex
impl RawMutex
pub fn new(recursive: bool) -> Self
pub fn is_valid_pointer(pointer: *const RawMutex) -> bool
Sourcepub unsafe fn from_pointer<'a>(pointer: *const RawMutex) -> Option<&'a Self>
pub unsafe fn from_pointer<'a>(pointer: *const RawMutex) -> Option<&'a Self>
Transforms a pointer to a reference.
§Safety
This function is unsafe because it dereferences a raw pointer. The caller must ensure the pointer is valid and points to properly initialized memory.
Sourcepub unsafe fn from_mutable_pointer<'a>(
pointer: *mut RawMutex,
) -> Option<&'a mut Self>
pub unsafe fn from_mutable_pointer<'a>( pointer: *mut RawMutex, ) -> Option<&'a mut Self>
Transforms a mutable pointer to a mutable reference.
§Safety
This function is unsafe because it dereferences a raw pointer. The caller must ensure the pointer is valid and points to properly initialized memory.
pub fn lock(&self) -> bool
pub fn unlock(&self) -> bool
Auto Trait Implementations§
impl !Freeze for RawMutex
impl !RefUnwindSafe for RawMutex
impl Send for RawMutex
impl Sync for RawMutex
impl Unpin for RawMutex
impl UnwindSafe for RawMutex
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