Enum piston_window::prelude::Motion
source · pub enum Motion {
MouseCursor([f64; 2]),
MouseRelative([f64; 2]),
MouseScroll([f64; 2]),
ControllerAxis(ControllerAxisArgs),
Touch(TouchArgs),
}
Expand description
Models different kinds of motion.
Variants§
MouseCursor([f64; 2])
Position in window coordinates.
MouseRelative([f64; 2])
Position in relative coordinates.
MouseScroll([f64; 2])
Position in scroll ticks.
ControllerAxis(ControllerAxisArgs)
Controller axis move event.
Touch(TouchArgs)
Touch event.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Motion
impl<'de> Deserialize<'de> for Motion
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Motion, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Motion, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<ControllerAxisArgs> for Motion
impl From<ControllerAxisArgs> for Motion
source§fn from(args: ControllerAxisArgs) -> Motion
fn from(args: ControllerAxisArgs) -> Motion
Converts to this type from the input type.
source§impl PartialEq for Motion
impl PartialEq for Motion
source§impl PartialOrd for Motion
impl PartialOrd for Motion
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 Serialize for Motion
impl Serialize for Motion
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for Motion
impl StructuralPartialEq for Motion
Auto Trait Implementations§
impl Freeze for Motion
impl RefUnwindSafe for Motion
impl Send for Motion
impl Sync for Motion
impl Unpin for Motion
impl UnwindSafe for Motion
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