Enum piston::Event[][src]

pub enum Event {
    Input(InputOption<u32>),
    Loop(Loop),
    Custom(EventIdArc<dyn Any + Send + Sync + 'static>, Option<u32>),
}
Expand description

Models all events.

Variants

Input(InputOption<u32>)

Input events.

Time stamp is ignored when comparing input events for equality and order.

Tuple Fields of Input

0: Input1: Option<u32>
Loop(Loop)

Events that commonly used by event loops.

Tuple Fields of Loop

0: Loop
Custom(EventIdArc<dyn Any + Send + Sync + 'static>, 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.

Tuple Fields of Custom

0: EventId1: Arc<dyn Any + Send + Sync + 'static>2: Option<u32>

Trait Implementations

Creates an after render event.

Calls closure if this is an after render event.

Returns after render arguments.

Creates a button event. Read more

Calls closure if this is a button event.

Returns button arguments.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Creates a close event from arguments. Read more

Calls closure if this is a close event.

Returns close arguments.

Creates a controller axis event. Read more

Calls closure if this is a controller axis event.

Returns controller axis arguments.

Creates a cursor event. Read more

Calls closure if this is a cursor event.

Returns cursor arguments.

Formats the value using the given formatter. Read more

Creates a focus event. Read more

Calls closure if this is a focus event.

Returns focus arguments.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

The id of this event.

Calls closure with arguments

Gets the time stamp of this event. Read more

Creates an idle event.

Calls closure if this is an idle event.

Creates an update event with delta time.

Returns idle arguments.

Creates a mouse cursor event. Read more

Calls closure if this is a mouse cursor event.

Returns mouse cursor arguments.

Creates a mouse relative event. Read more

Calls closure if this is a mouse relative event.

Returns mouse relative arguments.

Creates a mouse scroll event. Read more

Calls a closure if this is a mouse scroll event.

Returns mouse scroll arguments.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Creates a render event.

Calls closure if this is a render event.

Returns render arguments.

Creates a resize event. Read more

Calls closure if this is a resize event.

Returns resize arguments.

Creates a text event. Read more

Calls closure if this is a text event.

Returns text arguments.

Creates a touch event. Read more

Calls closure if this is a touch event.

Returns touch arguments.

Creates an update event.

Calls closure if this is an update event.

Creates an update event with delta time.

Returns update arguments.

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.

Creates a press event. Read more

Calls closure if this is a press event.

Returns press arguments.

Creates a release event. Read more

Calls closure if this is a release event.

Returns release arguments.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.