Enum piston::Event [−][src]
pub enum Event { Input(Input, Option<u32>), Loop(Loop), Custom(EventId, Arc<dyn Any + 'static + Sync + Send>, Option<u32>), }
Models all events.
Variants
Input events.
Time stamp is ignored when comparing input events for equality and order.
Loop(Loop)
Events that commonly used by event loops.
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
impl AfterRenderEvent for Event
[src]
pub fn from_after_render_args(
args: &AfterRenderArgs,
_old_event: &Event
) -> Option<Event>
[src]
args: &AfterRenderArgs,
_old_event: &Event
) -> Option<Event>
pub fn after_render<U, F>(&self, f: F) -> Option<U> where
F: FnMut(&AfterRenderArgs) -> U,
[src]
F: FnMut(&AfterRenderArgs) -> U,
pub fn after_render_args(&self) -> Option<AfterRenderArgs>
[src]
impl ButtonEvent for Event
[src]
pub fn from_button_args(args: ButtonArgs, old_event: &Event) -> Option<Event>
[src]
pub fn button<U, F>(&self, f: F) -> Option<U> where
F: FnMut(ButtonArgs) -> U,
[src]
F: FnMut(ButtonArgs) -> U,
pub fn button_args(&self) -> Option<ButtonArgs>
[src]
impl Clone for Event
[src]
impl CloseEvent for Event
[src]
pub fn from_close_args(args: &CloseArgs, old_event: &Event) -> Option<Event>
[src]
pub fn close<U, F>(&self, f: F) -> Option<U> where
F: FnMut(&CloseArgs) -> U,
[src]
F: FnMut(&CloseArgs) -> U,
pub fn close_args(&self) -> Option<CloseArgs>
[src]
impl ControllerAxisEvent for Event
[src]
pub fn from_controller_axis_args(
args: ControllerAxisArgs,
old_event: &Event
) -> Option<Event>
[src]
args: ControllerAxisArgs,
old_event: &Event
) -> Option<Event>
pub fn controller_axis<U, F>(&self, f: F) -> Option<U> where
F: FnMut(ControllerAxisArgs) -> U,
[src]
F: FnMut(ControllerAxisArgs) -> U,
pub fn controller_axis_args(&self) -> Option<ControllerAxisArgs>
[src]
impl CursorEvent for Event
[src]
pub fn from_cursor(cursor: bool, old_event: &Event) -> Option<Event>
[src]
pub fn cursor<U, F>(&self, f: F) -> Option<U> where
F: FnMut(bool) -> U,
[src]
F: FnMut(bool) -> U,
pub fn cursor_args(&self) -> Option<bool>
[src]
impl Debug for Event
[src]
impl FocusEvent for Event
[src]
pub fn from_focused(focused: bool, old_event: &Event) -> Option<Event>
[src]
pub fn focus<U, F>(&self, f: F) -> Option<U> where
F: FnMut(bool) -> U,
[src]
F: FnMut(bool) -> U,
pub fn focus_args(&self) -> Option<bool>
[src]
impl<T> From<(T, Option<u32>)> for Event where
Input: From<T>,
[src]
Input: From<T>,
impl From<AfterRenderArgs> for Event
[src]
pub fn from(args: AfterRenderArgs) -> Event
[src]
impl From<IdleArgs> for Event
[src]
impl From<Loop> for Event
[src]
impl From<RenderArgs> for Event
[src]
pub fn from(args: RenderArgs) -> Event
[src]
impl<T> From<T> for Event where
Input: From<T>,
[src]
Input: From<T>,
impl From<UpdateArgs> for Event
[src]
pub fn from(args: UpdateArgs) -> Event
[src]
impl GenericEvent for Event
[src]
pub fn event_id(&self) -> EventId
[src]
pub fn with_args<F, U>(&'a self, f: F) -> U where
F: FnMut(&(dyn Any + 'static)) -> U,
[src]
F: FnMut(&(dyn Any + 'static)) -> U,
pub fn time_stamp(&self) -> Option<u32>
[src]
impl IdleEvent for Event
[src]
pub fn from_idle_args(args: &IdleArgs, _old_event: &Event) -> Option<Event>
[src]
pub fn idle<U, F>(&self, f: F) -> Option<U> where
F: FnMut(&IdleArgs) -> U,
[src]
F: FnMut(&IdleArgs) -> U,
pub fn from_dt(dt: f64, old_event: &Self) -> Option<Self>
[src]
pub fn idle_args(&self) -> Option<IdleArgs>
[src]
impl Into<Option<Input>> for Event
[src]
impl Into<Option<Loop>> for Event
[src]
impl MouseCursorEvent for Event
[src]
pub fn from_pos(pos: [f64; 2], old_event: &Event) -> Option<Event>
[src]
pub fn mouse_cursor<U, F>(&self, f: F) -> Option<U> where
F: FnMut([f64; 2]) -> U,
[src]
F: FnMut([f64; 2]) -> U,
pub fn mouse_cursor_args(&self) -> Option<[f64; 2]>
[src]
impl MouseRelativeEvent for Event
[src]
pub fn from_pos(pos: [f64; 2], old_event: &Event) -> Option<Event>
[src]
pub fn mouse_relative<U, F>(&self, f: F) -> Option<U> where
F: FnMut([f64; 2]) -> U,
[src]
F: FnMut([f64; 2]) -> U,
pub fn mouse_relative_args(&self) -> Option<[f64; 2]>
[src]
impl MouseScrollEvent for Event
[src]
pub fn from_pos(pos: [f64; 2], old_event: &Event) -> Option<Event>
[src]
pub fn mouse_scroll<U, F>(&self, f: F) -> Option<U> where
F: FnMut([f64; 2]) -> U,
[src]
F: FnMut([f64; 2]) -> U,
pub fn mouse_scroll_args(&self) -> Option<[f64; 2]>
[src]
impl PartialEq<Event> for Event
[src]
pub fn eq(&self, other: &Event) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn ne(&self, other: &Rhs) -> boolimpl PartialOrd<Event> for Event
[src]
pub fn partial_cmp(&self, other: &Event) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn lt(&self, other: &Rhs) -> bool#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn le(&self, other: &Rhs) -> bool#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn gt(&self, other: &Rhs) -> bool#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn ge(&self, other: &Rhs) -> boolimpl RenderEvent for Event
[src]
pub fn from_render_args(args: &RenderArgs, _old_event: &Event) -> Option<Event>
[src]
pub fn render<U, F>(&self, f: F) -> Option<U> where
F: FnMut(&RenderArgs) -> U,
[src]
F: FnMut(&RenderArgs) -> U,
pub fn render_args(&self) -> Option<RenderArgs>
[src]
impl ResizeEvent for Event
[src]
pub fn from_resize_args(args: &ResizeArgs, old_event: &Event) -> Option<Event>
[src]
pub fn resize<U, F>(&self, f: F) -> Option<U> where
F: FnMut(&ResizeArgs) -> U,
[src]
F: FnMut(&ResizeArgs) -> U,
pub fn resize_args(&self) -> Option<ResizeArgs>
[src]
impl TextEvent for Event
[src]
pub fn from_text(text: &str, old_event: &Event) -> Option<Event>
[src]
pub fn text<U, F>(&self, f: F) -> Option<U> where
F: FnMut(&str) -> U,
[src]
F: FnMut(&str) -> U,
pub fn text_args(&self) -> Option<String>
[src]
impl TouchEvent for Event
[src]
pub fn from_touch_args(args: &TouchArgs, old_event: &Event) -> Option<Event>
[src]
pub fn touch<U, F>(&self, f: F) -> Option<U> where
F: FnMut(&TouchArgs) -> U,
[src]
F: FnMut(&TouchArgs) -> U,
pub fn touch_args(&self) -> Option<TouchArgs>
[src]
impl UpdateEvent for Event
[src]
pub fn from_update_args(args: &UpdateArgs, _old_event: &Event) -> Option<Event>
[src]
pub fn update<U, F>(&self, f: F) -> Option<U> where
F: FnMut(&UpdateArgs) -> U,
[src]
F: FnMut(&UpdateArgs) -> U,
pub fn from_dt(dt: f64, old_event: &Self) -> Option<Self>
[src]
pub fn update_args(&self) -> Option<UpdateArgs>
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl !UnwindSafe for Event
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> PressEvent for T where
T: ButtonEvent,
[src]
T: ButtonEvent,
pub fn from_button(button: Button, old_event: &T) -> Option<T>
[src]
pub fn press<U, F>(&self, f: F) -> Option<U> where
F: FnMut(Button) -> U,
[src]
F: FnMut(Button) -> U,
pub fn press_args(&self) -> Option<Button>
[src]
impl<T> ReleaseEvent for T where
T: ButtonEvent,
[src]
T: ButtonEvent,
pub fn from_button(button: Button, old_event: &T) -> Option<T>
[src]
pub fn release<U, F>(&self, f: F) -> Option<U> where
F: FnMut(Button) -> U,
[src]
F: FnMut(Button) -> U,
pub fn release_args(&self) -> Option<Button>
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,