pub struct LightEvent { /* private fields */ }Expand description
A lightweight event object with the same API as Event but suitable for const initialization.
Implementations§
Source§impl LightEvent
impl LightEvent
Sourcepub const fn new(signaled: bool, clear_mode: EventClearMode) -> Self
pub const fn new(signaled: bool, clear_mode: EventClearMode) -> Self
Creates a new light event. If signaled is true the event starts in the signaled state.
Sourcepub fn try_wait(&self) -> bool
pub fn try_wait(&self) -> bool
Returns true if the event is currently signaled without blocking.
Sourcepub fn wait_timeout(&self, timeout: Duration) -> bool
pub fn wait_timeout(&self, timeout: Duration) -> bool
Blocks until the event is signaled or timeout elapses. Returns true if signaled.
Trait Implementations§
Source§impl Drop for LightEvent
impl Drop for LightEvent
Auto Trait Implementations§
impl !Freeze for LightEvent
impl !RefUnwindSafe for LightEvent
impl !Sync for LightEvent
impl Send for LightEvent
impl Unpin for LightEvent
impl UnsafeUnpin for LightEvent
impl UnwindSafe for LightEvent
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