#[repr(C)]pub struct Lock<T: ?Sized, B: Backend> { /* private fields */ }Expand description
A mutual exclusion primitive.
Exposes one of the kernel locking primitives. Which one is exposed depends on the lock
Backend specified as the generic parameter B.
Implementations§
Source§impl<B: Backend> Lock<(), B>
impl<B: Backend> Lock<(), B>
Sourcepub unsafe fn from_raw<'a>(ptr: *mut B::State) -> &'a Self
pub unsafe fn from_raw<'a>(ptr: *mut B::State) -> &'a Self
Constructs a Lock from a raw pointer.
This can be useful for interacting with a lock which was initialised outside of Rust.
§Safety
The caller promises that ptr points to a valid initialised instance of State during
the whole lifetime of 'a.
- the memory range
[, + sizeof()*]must be fully initialized for type ``
Trait Implementations§
impl<T: ?Sized + Send, B: Backend> Send for Lock<T, B>
impl<T: ?Sized + Send, B: Backend> Sync for Lock<T, B>
Auto Trait Implementations§
impl<T, B> !Freeze for Lock<T, B>
impl<T, B> !RefUnwindSafe for Lock<T, B>
impl<T, B> UnwindSafe for Lock<T, B>
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
Source§impl<T> PinInit<T> for T
impl<T> PinInit<T> for T
Source§unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
Initializes
slot. Read more