pub enum Rotation {
Radians(Numeric),
Degrees(Numeric),
Percent(Numeric),
}Expand description
Encodes a rotation in various units
Variants§
Radians(Numeric)
Radian units (2π rad for one full rotation)
Degrees(Numeric)
Degree units (360 deg for one full rotation)
Percent(Numeric)
Percentage units (100% for one full rotation)
Implementations§
Source§impl Rotation
impl Rotation
Sourcepub fn to_float_0_1(&self) -> f64
pub fn to_float_0_1(&self) -> f64
Returns a normalized float proportional to 0deg : 0.0 :: 360deg : 1.0.
For example, 0rad maps to 0.0, 100% maps to 1.0, and 720deg
maps to 2.0.
Sourcepub fn get_as_radians(&self) -> f64
pub fn get_as_radians(&self) -> f64
Returns the rotation as radians, regardless of the original unit
Sourcepub fn get_as_degrees(&self) -> f64
pub fn get_as_degrees(&self) -> f64
Returns the rotation as degrees, regardless of the original unit
Trait Implementations§
Source§impl CoercionRules for Rotation
impl CoercionRules for Rotation
impl Copy for Rotation
Source§impl<'de> Deserialize<'de> for Rotation
impl<'de> Deserialize<'de> for Rotation
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Rotation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Rotation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl HelperFunctions for Rotation
impl HelperFunctions for Rotation
Source§fn register_all_functions()
fn register_all_functions()
Registers all helper functions for this type.
Source§impl Interpolatable for Rotation
impl Interpolatable for Rotation
Source§impl Serialize for Rotation
impl Serialize for Rotation
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 StructuralPartialEq for Rotation
Source§impl ToPaxValue for Rotation
impl ToPaxValue for Rotation
Source§fn to_pax_value(self) -> PaxValue
fn to_pax_value(self) -> PaxValue
Converts this value into a
PaxValue.Auto Trait Implementations§
impl Freeze for Rotation
impl RefUnwindSafe for Rotation
impl Send for Rotation
impl Sync for Rotation
impl Unpin for Rotation
impl UnsafeUnpin for Rotation
impl UnwindSafe for Rotation
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> PropertyValue for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
Source§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.