Struct winit_main::EventReceiver[][src]

pub struct EventReceiver(_);
Expand description

Handle for receiving events from the main event loop.

Unlike a raw std::sync::mpsc::Receiver, this never returns error on disconnection, because disconnection can only occur for a brief moment between the main event loop beginning to shut down, and the process as a whole exiting. Therefore, when this receives a disconnection error from the underlying receiver, it enters an infinite sleep cycle as it waits for the OS to kill the process.

Implementations

Receive an event, blocking until one is available.

Attempt to receive an event, blocking until one is available, or the timeout duration has passed.

Try to receive an event immediately, never blocking.

Iterator form of self.recv(). Blocking iterator that never ends.

Iterator form of self.try_recv(). Non-blocking iterator that drains the events currently in the queue.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.