LocalEvent

Struct LocalEvent 

Source
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

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'a> EventSetter<'a> for LocalEvent

Source§

type Waiter = LocalEventAwait<'a>

The future representing a pending acquisition of the event.
Source§

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

Creates an event in the set state. This means that the event can be immediately acquired.
Source§

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

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

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)

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

If the event has any pending waiters.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Reclaim for T