Struct Events

Source
pub struct Events<S> { /* private fields */ }
Expand description

Shared event mask.

The event mask is an atomic bitmask shared between the executor and the event sources. The type parameter S is an EventMask.

§Events or signals?

They are the same. The name “event” refers to their presence in the shared event mask, while the name “signal” refers to poll-local signal masks. Events become signals when they are handled or waited for.

Implementations§

Source§

impl<S> Events<S>

Source

pub const fn new() -> Self

Construct a new event mask.

This is the same as Events::default() but is also const.

Source

pub fn watch(&self) -> Signals<'_, S>

Associate a new Signals to this event mask.

This indirectly links the executor to the event mask, since creating an Executor requires a Signals.

Source§

impl<S: EventMask> Events<S>

Source

pub fn raise(&self, signals: S)

Raise all events in a mask.

This operation is atomic: multiple events can be safely raised at the same time. Already raised signals are left as is.

Trait Implementations§

Source§

impl<S> Default for Events<S>

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<S> !Freeze for Events<S>

§

impl<S> RefUnwindSafe for Events<S>
where S: RefUnwindSafe,

§

impl<S> Send for Events<S>
where S: Send,

§

impl<S> Sync for Events<S>
where S: Sync,

§

impl<S> Unpin for Events<S>
where S: Unpin,

§

impl<S> UnwindSafe for Events<S>
where S: UnwindSafe,

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.