pub struct Arbiter<T> { /* private fields */ }
Expand description
An FIFO waitqueue for use in shared bus usecases.
Implementations§
source§impl<T> Arbiter<T>
impl<T> Arbiter<T>
sourcepub async fn access(&self) -> ExclusiveAccess<'_, T>
pub async fn access(&self) -> ExclusiveAccess<'_, T>
Get access to the inner value in the Arbiter
. This will wait until access is granted,
for non-blocking access use try_access
.
sourcepub fn try_access(&self) -> Option<ExclusiveAccess<'_, T>>
pub fn try_access(&self) -> Option<ExclusiveAccess<'_, T>>
Non-blockingly tries to access the underlying value.
If someone is in queue to get it, this will return None
.
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for Arbiter<T>
impl<T> !RefUnwindSafe for Arbiter<T>
impl<T> Unpin for Arbiter<T>where
T: Unpin,
impl<T> UnwindSafe for Arbiter<T>where
T: UnwindSafe,
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