Enum piston_window::prelude::Event
source · pub enum Event {
Input(Input, Option<u32>),
Loop(Loop),
Custom(EventId, Arc<dyn Any + Send + Sync>, Option<u32>),
}
Expand description
Models all events.
Variants§
Input(Input, Option<u32>)
Input events.
Time stamp is ignored when comparing input events for equality and order.
Loop(Loop)
Events that commonly used by event loops.
Custom(EventId, Arc<dyn Any + Send + Sync>, Option<u32>)
Custom event.
When comparing two custom events for equality,
they always return false
.
When comparing partial order of two custom events,
the event ids are checked and if they are equal it returns None
.
Time stamp is ignored both when comparing custom events for equality and order.
Trait Implementations§
source§impl AfterRenderEvent for Event
impl AfterRenderEvent for Event
source§fn from_after_render_args(
args: &AfterRenderArgs,
_old_event: &Event
) -> Option<Event>
fn from_after_render_args( args: &AfterRenderArgs, _old_event: &Event ) -> Option<Event>
Creates an after render event.
source§fn after_render<U, F>(&self, f: F) -> Option<U>where
F: FnMut(&AfterRenderArgs) -> U,
fn after_render<U, F>(&self, f: F) -> Option<U>where
F: FnMut(&AfterRenderArgs) -> U,
Calls closure if this is an after render event.
source§fn after_render_args(&self) -> Option<AfterRenderArgs>
fn after_render_args(&self) -> Option<AfterRenderArgs>
Returns after render arguments.
source§impl ButtonEvent for Event
impl ButtonEvent for Event
source§impl CloseEvent for Event
impl CloseEvent for Event
source§impl ControllerAxisEvent for Event
impl ControllerAxisEvent for Event
source§fn from_controller_axis_args(
args: ControllerAxisArgs,
old_event: &Event
) -> Option<Event>
fn from_controller_axis_args( args: ControllerAxisArgs, old_event: &Event ) -> Option<Event>
Creates a controller axis event. Read more
source§fn controller_axis<U, F>(&self, f: F) -> Option<U>where
F: FnMut(ControllerAxisArgs) -> U,
fn controller_axis<U, F>(&self, f: F) -> Option<U>where
F: FnMut(ControllerAxisArgs) -> U,
Calls closure if this is a controller axis event.
source§fn controller_axis_args(&self) -> Option<ControllerAxisArgs>
fn controller_axis_args(&self) -> Option<ControllerAxisArgs>
Returns controller axis arguments.
source§impl CursorEvent for Event
impl CursorEvent for Event
source§impl FocusEvent for Event
impl FocusEvent for Event
source§impl From<AfterRenderArgs> for Event
impl From<AfterRenderArgs> for Event
source§fn from(args: AfterRenderArgs) -> Event
fn from(args: AfterRenderArgs) -> Event
Converts to this type from the input type.
source§impl From<RenderArgs> for Event
impl From<RenderArgs> for Event
source§fn from(args: RenderArgs) -> Event
fn from(args: RenderArgs) -> Event
Converts to this type from the input type.
source§impl From<UpdateArgs> for Event
impl From<UpdateArgs> for Event
source§fn from(args: UpdateArgs) -> Event
fn from(args: UpdateArgs) -> Event
Converts to this type from the input type.
source§impl GenericEvent for Event
impl GenericEvent for Event
source§impl IdleEvent for Event
impl IdleEvent for Event
source§impl MouseCursorEvent for Event
impl MouseCursorEvent for Event
source§impl MouseRelativeEvent for Event
impl MouseRelativeEvent for Event
source§impl MouseScrollEvent for Event
impl MouseScrollEvent for Event
source§impl PartialEq for Event
impl PartialEq for Event
source§impl PartialOrd for Event
impl PartialOrd for Event
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl RenderEvent for Event
impl RenderEvent for Event
source§fn from_render_args(args: &RenderArgs, _old_event: &Event) -> Option<Event>
fn from_render_args(args: &RenderArgs, _old_event: &Event) -> Option<Event>
Creates a render event.
source§fn render<U, F>(&self, f: F) -> Option<U>where
F: FnMut(&RenderArgs) -> U,
fn render<U, F>(&self, f: F) -> Option<U>where
F: FnMut(&RenderArgs) -> U,
Calls closure if this is a render event.
source§fn render_args(&self) -> Option<RenderArgs>
fn render_args(&self) -> Option<RenderArgs>
Returns render arguments.
source§impl ResizeEvent for Event
impl ResizeEvent for Event
source§fn from_resize_args(args: &ResizeArgs, old_event: &Event) -> Option<Event>
fn from_resize_args(args: &ResizeArgs, old_event: &Event) -> Option<Event>
Creates a resize event. Read more
source§fn resize<U, F>(&self, f: F) -> Option<U>where
F: FnMut(&ResizeArgs) -> U,
fn resize<U, F>(&self, f: F) -> Option<U>where
F: FnMut(&ResizeArgs) -> U,
Calls closure if this is a resize event.
source§fn resize_args(&self) -> Option<ResizeArgs>
fn resize_args(&self) -> Option<ResizeArgs>
Returns resize arguments.
source§impl TouchEvent for Event
impl TouchEvent for Event
source§impl UpdateEvent for Event
impl UpdateEvent for Event
source§fn from_update_args(args: &UpdateArgs, _old_event: &Event) -> Option<Event>
fn from_update_args(args: &UpdateArgs, _old_event: &Event) -> Option<Event>
Creates an update event.
source§fn update<U, F>(&self, f: F) -> Option<U>where
F: FnMut(&UpdateArgs) -> U,
fn update<U, F>(&self, f: F) -> Option<U>where
F: FnMut(&UpdateArgs) -> U,
Calls closure if this is an update event.
source§fn from_dt(dt: f64, old_event: &Self) -> Option<Self>
fn from_dt(dt: f64, old_event: &Self) -> Option<Self>
Creates an update event with delta time.
source§fn update_args(&self) -> Option<UpdateArgs>
fn update_args(&self) -> Option<UpdateArgs>
Returns update arguments.
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