pub enum Event {
Seek(Duration),
Pause(bool),
NotConnected,
}Expand description
An Event type.
Variants§
Seek(Duration)
The tracker changes row, asking you to update your time source.
Pause(bool)
The tracker pauses or unpauses.
NotConnected
The client is not connected. Next calls to poll_events will eventually attempt to
reconnect.
There are three equally sensible ways to handle this variant:
break: End your event pollingwhile let-loop and proceed to rendering the frame. AllRocketmethods keep working, but without control from the tracker.continue 'main: Restart your main loop, don’t render the frame. This lets you keep calling other event polling functions from other libraries, e.g. SDL or winit.{}: Ignore it and let your event polling loop continue.
Options 2 and 3 result is a busy wait, e.g. waste a lot of CPU time.
It’s better to combine them with std::thread::sleep for at least a few milliseconds in order to mitigate that.
See simple.rs in the examples-directory.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more