pub struct Event { /* private fields */ }
Expand description
An Event is an Type that can send Signals to other parts of the code. They can be automatically or manually reset. With manually reset events all waiting threads are worken up, but with automatically reset Event only one wakes up and can do the work.
An Automatically reset Event can trigger multiple times in a row and wake a whole lot of threads up
Implementations§
Source§impl Event
impl Event
Sourcepub fn signal(&self) -> Result<bool, Error>
pub fn signal(&self) -> Result<bool, Error>
Triggers the event and signals all Threads waiting on it. The Event has to be reset after callling the function It returns if the signal was previously triggered
Sourcepub fn reset(&self) -> Result<bool, Error>
pub fn reset(&self) -> Result<bool, Error>
Event::reset resets manual Events. It does nothing in Automatic Events
Sourcepub fn pulse(&self) -> Result<bool, Error>
pub fn pulse(&self) -> Result<bool, Error>
Sets and resets the Event in an Atomic Operation. Simultanous Reads will show the Event as unsignaled
Sourcepub fn status(&self) -> Result<EventStatus, Error>
pub fn status(&self) -> Result<EventStatus, Error>
Returns the Status at the moment of the Query.
Trait Implementations§
Source§impl From<Event> for EventSources
impl From<Event> for EventSources
impl Copy for Event
impl Eq for Event
impl Send for Event
impl StructuralPartialEq for Event
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Sync for Event
impl Unpin 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