#[repr(transparent)]pub struct MutexRef<'a, System: KernelMutex>(_, _);
Expand description
Represents a single borrowed mutex in a system.
This type is ABI-compatible with System::
RawMutexId
. It’s
logically equivalent to &'a Mutex
but instead stores RawMutexId
directly.
See Mutex
for the owned counterpart and the description
of this kernel object.
See MutexMethods
for the operations provided by this handle
type.
Implementations
sourceimpl<System: KernelMutex> MutexRef<'static, System>
impl<System: KernelMutex> MutexRef<'static, System>
sourcepub const fn define() -> MutexDefiner<System>
pub const fn define() -> MutexDefiner<System>
Construct a MutexDefiner
to define a mutex in a
configuration function.
Trait Implementations
sourceimpl<System: KernelMutex> Clone for MutexRef<'_, System>
impl<System: KernelMutex> Clone for MutexRef<'_, System>
sourceimpl<System: KernelMutex> Debug for MutexRef<'_, System>
impl<System: KernelMutex> Debug for MutexRef<'_, System>
sourceimpl<System: KernelMutex> Hash for MutexRef<'_, System>
impl<System: KernelMutex> Hash for MutexRef<'_, System>
sourceimpl<System: KernelMutex> MutexHandle for MutexRef<'_, System>
impl<System: KernelMutex> MutexHandle for MutexRef<'_, System>
type System = System
type System = System
The system type this object pertains to.
sourceconst unsafe fn from_id(id: <System as KernelMutex>::RawMutexId) -> Self
const unsafe fn from_id(id: <System as KernelMutex>::RawMutexId) -> Self
sourceconst fn id(&self) -> System::RawMutexId
const fn id(&self) -> System::RawMutexId
Get the raw
RawMutexId
value representing this object.sourceimpl<System: NotSupportedYet> PartialEq<Mutex<System>> for MutexRef<'_, System>
impl<System: NotSupportedYet> PartialEq<Mutex<System>> for MutexRef<'_, System>
sourceimpl<System: NotSupportedYet> PartialEq<MutexRef<'_, System>> for Mutex<System>
impl<System: NotSupportedYet> PartialEq<MutexRef<'_, System>> for Mutex<System>
sourceimpl<System: KernelMutex> PartialEq<MutexRef<'_, System>> for MutexRef<'_, System>
impl<System: KernelMutex> PartialEq<MutexRef<'_, System>> for MutexRef<'_, System>
impl<System: KernelMutex> Copy for MutexRef<'_, System>
impl<System: KernelMutex> Eq for MutexRef<'_, System>
Auto Trait Implementations
impl<'a, System> RefUnwindSafe for MutexRef<'a, System>where
<System as KernelMutex>::RawMutexId: RefUnwindSafe,
impl<'a, System> Send for MutexRef<'a, System>
impl<'a, System> Sync for MutexRef<'a, System>
impl<'a, System> Unpin for MutexRef<'a, System>where
<System as KernelMutex>::RawMutexId: Unpin,
impl<'a, System> UnwindSafe for MutexRef<'a, System>where
<System as KernelMutex>::RawMutexId: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> MutexMethods for Twhere
T: MutexHandle,
impl<T> MutexMethods for Twhere
T: MutexHandle,
sourcefn is_locked(&self) -> Result<bool, QueryMutexError>
fn is_locked(&self) -> Result<bool, QueryMutexError>
Get a flag indicating whether the mutex is currently locked.
sourcefn lock(&self) -> Result<(), LockMutexError>
fn lock(&self) -> Result<(), LockMutexError>
Acquire the mutex, blocking the current thread until it is able to do
so. Read more
sourcefn lock_timeout(&self, timeout: Duration) -> Result<(), LockMutexTimeoutError>
fn lock_timeout(&self, timeout: Duration) -> Result<(), LockMutexTimeoutError>
lock
with timeout.sourcefn try_lock(&self) -> Result<(), TryLockMutexError>
fn try_lock(&self) -> Result<(), TryLockMutexError>
Non-blocking version of
lock
. Returns
immediately with TryLockMutexError::Timeout
if the unblocking
condition is not satisfied. Read moresourcefn mark_consistent(&self) -> Result<(), MarkConsistentMutexError>
fn mark_consistent(&self) -> Result<(), MarkConsistentMutexError>
Mark the state protected by the mutex as consistent. Read more