Struct shared_bus::AtomicCheckMutex [−][src]
pub struct AtomicCheckMutex<BUS> { /* fields omitted */ }
A simple coherency checker for sharing across multiple tasks/threads.
This mutex type can be used when all bus users are contained in a single structure, and is intended for use with RTIC. When all bus users are contained within a structure managed by RTIC, RTIC will guarantee that bus collisions do not occur. To protect against accidentaly misuse, this mutex uses an atomic bool to determine when the bus is in use. If a bus collision is detected, the code will panic.
This mutex type is used with the BusManagerAtomicMutex
type.
This manager type is explicitly safe to share across threads because it checks to ensure that collisions due to bus sharing do not occur.
Trait Implementations
impl<BUS> BusMutex for AtomicCheckMutex<BUS>
[src]
type Bus = BUS
The actual bus that is wrapped inside this mutex.
fn create(v: BUS) -> Self
[src]
fn lock<R, F: FnOnce(&mut Self::Bus) -> R>(&self, f: F) -> R
[src]
impl<BUS: Debug> Debug for AtomicCheckMutex<BUS>
[src]
impl<BUS> Sync for AtomicCheckMutex<BUS>
[src]
Auto Trait Implementations
impl<BUS> !RefUnwindSafe for AtomicCheckMutex<BUS>
impl<BUS> Send for AtomicCheckMutex<BUS> where
BUS: Send,
BUS: Send,
impl<BUS> Unpin for AtomicCheckMutex<BUS> where
BUS: Unpin,
BUS: Unpin,
impl<BUS> UnwindSafe for AtomicCheckMutex<BUS> where
BUS: UnwindSafe,
BUS: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,