Struct r3_core::kernel::mutex::MutexRef

source ·
#[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§

source§

impl<System: KernelMutex> MutexRef<'static, System>

source

pub const fn define() -> MutexDefiner<System>

Construct a MutexDefiner to define a mutex in a configuration function.

Trait Implementations§

source§

impl<System: KernelMutex> Clone for MutexRef<'_, System>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<System: KernelMutex> Debug for MutexRef<'_, System>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<System: KernelMutex> Hash for MutexRef<'_, System>

source§

fn hash<H>(&self, state: &mut H)where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<System: KernelMutex> MutexHandle for MutexRef<'_, System>

§

type System = System

The system type this object pertains to.
source§

const unsafe fn from_id(id: <System as KernelMutex>::RawMutexId) -> Self

Construct a Mutex from RawMutexId. Read more
source§

const fn id(&self) -> System::RawMutexId

Get the raw RawMutexId value representing this object.
source§

const fn borrow(&self) -> MutexRef<'_, Self::System>

Borrow self as MutexRef.
source§

impl<System: NotSupportedYet> PartialEq<Mutex<System>> for MutexRef<'_, System>

source§

fn eq(&self, other: &Mutex<System>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<System: NotSupportedYet> PartialEq<MutexRef<'_, System>> for Mutex<System>

source§

fn eq(&self, other: &MutexRef<'_, System>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<System: KernelMutex> PartialEq<MutexRef<'_, System>> for MutexRef<'_, System>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<System: KernelMutex> Copy for MutexRef<'_, System>

source§

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§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> MutexMethods for Twhere T: MutexHandle,

source§

fn is_locked(&self) -> Result<bool, QueryMutexError>

Get a flag indicating whether the mutex is currently locked.
source§

fn unlock(&self) -> Result<(), UnlockMutexError>

Unlock the mutex. Read more
source§

fn lock(&self) -> Result<(), LockMutexError>

Acquire the mutex, blocking the current thread until it is able to do so. Read more
source§

fn lock_timeout(&self, timeout: Duration) -> Result<(), LockMutexTimeoutError>

lock with timeout.
source§

fn try_lock(&self) -> Result<(), TryLockMutexError>

Non-blocking version of lock. Returns immediately with TryLockMutexError::Timeout if the unblocking condition is not satisfied. Read more
source§

fn mark_consistent(&self) -> Result<(), MarkConsistentMutexError>

Mark the state protected by the mutex as consistent.
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.