starina_api::mainloop

Enum Event

Source
#[non_exhaustive]
pub enum Event<'a, Ctx, M: MessageDeserialize> { Message { ctx: &'a mut Ctx, message: M::Reader<'a>, sender: &'a mut ChannelSender, handle_id: HandleId, }, Interrupt { interrupt: &'a mut Interrupt, ctx: &'a mut Ctx, }, Error(Error), }
Expand description

Events that applications need to handle.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Message

A received message.

Fields

§ctx: &'a mut Ctx

The per-object state associated with the channel object.

§message: M::Reader<'a>

The received message.

§sender: &'a mut ChannelSender

The channel where the message is received.

§handle_id: HandleId

The handle ID of the channel.

§

Interrupt

A received hardware interrupts.

Fields

§interrupt: &'a mut Interrupt

The object which received the interrupt.

§ctx: &'a mut Ctx

The per-object state associated with the interrupt object.

§

Error(Error)

An error occurred when processing events.

Trait Implementations§

Source§

impl<'a, Ctx: Debug, M: Debug + MessageDeserialize> Debug for Event<'a, Ctx, M>
where M::Reader<'a>: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, Ctx, M> Freeze for Event<'a, Ctx, M>
where <M as MessageDeserialize>::Reader<'a>: Freeze,

§

impl<'a, Ctx, M> RefUnwindSafe for Event<'a, Ctx, M>

§

impl<'a, Ctx, M> Send for Event<'a, Ctx, M>
where <M as MessageDeserialize>::Reader<'a>: Send, Ctx: Send,

§

impl<'a, Ctx, M> Sync for Event<'a, Ctx, M>
where <M as MessageDeserialize>::Reader<'a>: Sync, Ctx: Sync,

§

impl<'a, Ctx, M> Unpin for Event<'a, Ctx, M>
where <M as MessageDeserialize>::Reader<'a>: Unpin,

§

impl<'a, Ctx, M> !UnwindSafe for Event<'a, Ctx, M>

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.