pub struct Event { /* private fields */ }Expand description
Binary event (signal/wait).
Implementations§
Source§impl Event
impl Event
Sourcepub fn create(storage: &'static EventStorage) -> Result<Self>
pub fn create(storage: &'static EventStorage) -> Result<Self>
Mode-agnostic constructor (see Mutex::create).
Sourcepub fn wait_for(&self, d: Duration) -> Result<()>
pub fn wait_for(&self, d: Duration) -> Result<()>
Wait for the event up to d. parking_lot::Condvar::wait_for
naming convention (waiting primitives don’t use the try_
prefix in parking_lot).
§Errors
Returns Error::Timeout if the event is not signalled within
d.
Sourcepub fn wait_until(&self, deadline: Instant) -> Result<()>
pub fn wait_until(&self, deadline: Instant) -> Result<()>
Wait for the event by the given deadline. Use
Instant::FOREVER for an
indefinite wait.
§Errors
Returns Error::Timeout if the deadline elapses before the event
is signalled.
Sourcepub fn signal_from_isr(&self)
pub fn signal_from_isr(&self)
Signal the event from an ISR context.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
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