[−][src]Struct winit_main::EventReceiver
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
impl EventReceiver
[src]
pub fn recv(&self) -> Event<'static, Blocker>
[src]
Receive an event, blocking until one is available.
pub fn recv_timeout(&self, timeout: Duration) -> Option<Event<'static, Blocker>>
[src]
Attempt to receive an event, blocking until one is available, or the
timeout
duration has passed.
pub fn try_recv(&self) -> Option<Event<'static, Blocker>>
[src]
Try to receive an event immediately, never blocking.
pub fn iter<'a>(&'a self) -> impl Iterator<Item = Event<'static, Blocker>> + 'a
[src]
Iterator form of self.recv()
. Blocking iterator that never ends.
pub fn try_iter<'a>(
&'a self
) -> impl Iterator<Item = Event<'static, Blocker>> + 'a
[src]
&'a self
) -> impl Iterator<Item = Event<'static, Blocker>> + 'a
Iterator form of self.try_recv()
. Non-blocking iterator that drains
the events currently in the queue.
Auto Trait Implementations
impl !RefUnwindSafe for EventReceiver
[src]
impl Send for EventReceiver
[src]
impl !Sync for EventReceiver
[src]
impl Unpin for EventReceiver
[src]
impl !UnwindSafe for EventReceiver
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,