freertos_rs

Struct MutexImpl

Source
pub struct MutexImpl<T: ?Sized, M> { /* private fields */ }
Expand description

Mutual exclusion access to a contained value. Can be recursive - the current owner of a lock can re-lock it.

Implementations§

Source§

impl<T> MutexImpl<T, MutexNormal>

Source

pub fn new(t: T) -> Result<Self, FreeRtosError>

Create a new mutex with the given inner value

Source§

impl<T> MutexImpl<T, MutexRecursive>

Source

pub fn new(t: T) -> Result<Self, FreeRtosError>

Create a new recursive mutex with the given inner value

Source§

impl<T, M> MutexImpl<T, M>
where M: MutexInnerImpl,

Source

pub fn lock<D: DurationTicks>( &self, max_wait: D, ) -> Result<MutexGuard<'_, T, M>, FreeRtosError>

Try to obtain a lock and mutable access to our inner value

Source

pub fn into_inner(self) -> T

Consume the mutex and return its inner value

Trait Implementations§

Source§

impl<T: ?Sized, M> Debug for MutexImpl<T, M>
where M: MutexInnerImpl + Debug,

Source§

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

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

impl<T: Sync + Send, M> Send for MutexImpl<T, M>

Source§

impl<T: Sync + Send, M> Sync for MutexImpl<T, M>

Auto Trait Implementations§

§

impl<T, M> !Freeze for MutexImpl<T, M>

§

impl<T, M> !RefUnwindSafe for MutexImpl<T, M>

§

impl<T, M> Unpin for MutexImpl<T, M>
where M: Unpin, T: Unpin + ?Sized,

§

impl<T, M> UnwindSafe for MutexImpl<T, M>
where M: UnwindSafe, T: UnwindSafe + ?Sized,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.