pub struct LocalEvent(/* private fields */);Expand description
An event for usage within local runtimess. It is !Send and
!Sync.
Trait Implementations§
Source§impl Default for LocalEvent
impl Default for LocalEvent
Source§impl<'a> EventSetter<'a> for LocalEvent
impl<'a> EventSetter<'a> for LocalEvent
Source§type Waiter = LocalEventAwait<'a>
type Waiter = LocalEventAwait<'a>
The future representing a pending acquisition of the event.
Source§fn new() -> Self
fn new() -> Self
Creates a new event in the unset state. This
is the expected mode of operation for most events,
and means that if a task begins waiting, they will
wait until the event is set.
Source§fn new_set() -> Self
fn new_set() -> Self
Creates an event in the set state. This means that the event
can be immediately acquired.
Source§fn wait(&'a self) -> LocalEventAwait<'a> ⓘ
fn wait(&'a self) -> LocalEventAwait<'a> ⓘ
Waits on the event. This returns a future which when polled
will wait for the event to be acquired.
Source§fn try_wait(&self) -> bool
fn try_wait(&self) -> bool
Will try to immediately acquire the event along the fast path. This
method is non-blocking and will return true if we could acquire the event,
and false if we cannot. This will clear the set flag.
Source§fn set_one(&self) -> bool
fn set_one(&self) -> bool
Sets the event. This will wake up any events from the queue if
any are pending. This returns a boolean if we were able to actually
wake up an event or not.
Source§fn set_all<F: FnMut()>(&self, functor: F)
fn set_all<F: FnMut()>(&self, functor: F)
Sets the event and wakes up all events from the queue if they
are pending with the functor. This functor allows more advanced book-keeping
per event, for instance with counted events.
Source§fn has_waiters(&self) -> bool
fn has_waiters(&self) -> bool
If the event has any pending waiters.
Auto Trait Implementations§
impl !Freeze for LocalEvent
impl !RefUnwindSafe for LocalEvent
impl !Send for LocalEvent
impl !Sync for LocalEvent
impl Unpin for LocalEvent
impl !UnwindSafe for LocalEvent
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