Struct syunit::Acceleration
source · pub struct Acceleration(pub f32);
Expand description
Represents a change in velocity over time
§Unit
- Can be either radians per second^2 or millimeters per second^2
use syunit::*;
assert_eq!(Velocity(5.0), Acceleration(2.5) * Time(2.0));
assert_eq!(Acceleration(2.5), Velocity(5.0) / Time(2.0));
Tuple Fields§
§0: f32
Implementations§
source§impl Acceleration
impl Acceleration
sourcepub const NEG_INFINITY: Self = _
pub const NEG_INFINITY: Self = _
Negative Infinity value of this unit (f32::INFINITY)
sourcepub fn is_normal(self) -> bool
pub fn is_normal(self) -> bool
Returns true
if this units value is neither NaN, Infinite or zero
sourcepub fn is_sign_negative(self) -> bool
pub fn is_sign_negative(self) -> bool
Returns true
if the sign bit of this value is negative (value smaller than 0.0, -0.0 included)
sourcepub fn is_sign_positive(self) -> bool
pub fn is_sign_positive(self) -> bool
Returns true
if the sign bit of this value is positive (value smaller than 0.0, -0.0 included)
sourcepub fn max_ref<'a>(&'a self, other: &'a Self) -> &'a Self
pub fn max_ref<'a>(&'a self, other: &'a Self) -> &'a Self
Return the bigger value of this and another unit, working with references
sourcepub fn min_ref<'a>(&'a self, other: &'a Self) -> &'a Self
pub fn min_ref<'a>(&'a self, other: &'a Self) -> &'a Self
Return the bigger value of this and another unit, working with references
sourcepub fn get_direction(self) -> Direction
pub fn get_direction(self) -> Direction
Get the direction of the value (positive or negative)
0.0
will be accounted as positive
Trait Implementations§
source§impl Add for Acceleration
impl Add for Acceleration
§type Output = Acceleration
type Output = Acceleration
The resulting type after applying the
+
operator.source§impl AddAssign for Acceleration
impl AddAssign for Acceleration
source§fn add_assign(&mut self, rhs: Acceleration)
fn add_assign(&mut self, rhs: Acceleration)
Performs the
+=
operation. Read moresource§impl Clone for Acceleration
impl Clone for Acceleration
source§fn clone(&self) -> Acceleration
fn clone(&self) -> Acceleration
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Acceleration
impl Debug for Acceleration
source§impl Default for Acceleration
impl Default for Acceleration
source§fn default() -> Acceleration
fn default() -> Acceleration
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for Acceleration
impl<'de> Deserialize<'de> for Acceleration
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for Acceleration
impl Display for Acceleration
source§impl Div<Acceleration> for Force
impl Div<Acceleration> for Force
source§impl Div<Acceleration> for Velocity
impl Div<Acceleration> for Velocity
source§impl Div<Jolt> for Acceleration
impl Div<Jolt> for Acceleration
source§impl Div<Time> for Acceleration
impl Div<Time> for Acceleration
source§impl Div<f32> for Acceleration
impl Div<f32> for Acceleration
source§impl Div for Acceleration
impl Div for Acceleration
source§impl FromStr for Acceleration
impl FromStr for Acceleration
source§impl Into<f32> for Acceleration
impl Into<f32> for Acceleration
source§impl Mul<Acceleration> for Inertia
impl Mul<Acceleration> for Inertia
source§impl Mul<Acceleration> for Time
impl Mul<Acceleration> for Time
source§impl Mul<Acceleration> for f32
impl Mul<Acceleration> for f32
§type Output = Acceleration
type Output = Acceleration
The resulting type after applying the
*
operator.source§impl Mul<Inertia> for Acceleration
impl Mul<Inertia> for Acceleration
source§impl Mul<Time> for Acceleration
impl Mul<Time> for Acceleration
source§impl Mul<f32> for Acceleration
impl Mul<f32> for Acceleration
source§impl Neg for Acceleration
impl Neg for Acceleration
source§impl PartialEq for Acceleration
impl PartialEq for Acceleration
source§fn eq(&self, other: &Acceleration) -> bool
fn eq(&self, other: &Acceleration) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for Acceleration
impl PartialOrd for Acceleration
source§fn partial_cmp(&self, other: &Acceleration) -> Option<Ordering>
fn partial_cmp(&self, other: &Acceleration) -> Option<Ordering>
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 Acceleration
impl Serialize for Acceleration
source§impl Sub for Acceleration
impl Sub for Acceleration
§type Output = Acceleration
type Output = Acceleration
The resulting type after applying the
-
operator.source§impl SubAssign for Acceleration
impl SubAssign for Acceleration
source§fn sub_assign(&mut self, rhs: Acceleration)
fn sub_assign(&mut self, rhs: Acceleration)
Performs the
-=
operation. Read moresource§impl Unit for Acceleration
impl Unit for Acceleration
impl Copy for Acceleration
impl StructuralPartialEq for Acceleration
Auto Trait Implementations§
impl Freeze for Acceleration
impl RefUnwindSafe for Acceleration
impl Send for Acceleration
impl Sync for Acceleration
impl Unpin for Acceleration
impl UnwindSafe for Acceleration
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