pub struct Delta(pub f32);Expand description
The delta distance represents a relative distance traveled by the
§Unit
- Can be either radians or millimeters
use syunit::*;
assert_eq!(Delta(2.0), Delta(1.0) + Delta(1.0));
assert_eq!(Delta(5.0), Delta(2.5) * 2.0);
assert_eq!(Delta(2.0), Gamma(4.0) - Gamma(2.0));Tuple Fields§
§0: f32Implementations§
source§impl Delta
impl Delta
sourcepub const NEG_INFINITY: Delta = _
pub const NEG_INFINITY: Delta = _
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 Delta) -> &'a Delta
pub fn max_ref<'a>(&'a self, other: &'a Delta) -> &'a Delta
Return the bigger value of this and another unit, working with references
sourcepub fn min_ref<'a>(&'a self, other: &'a Delta) -> &'a Delta
pub fn min_ref<'a>(&'a self, other: &'a Delta) -> &'a Delta
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 AddAssign<Delta> for Gamma
impl AddAssign<Delta> for Gamma
source§fn add_assign(&mut self, rhs: Delta)
fn add_assign(&mut self, rhs: Delta)
Performs the
+= operation. Read moresource§impl AddAssign<Delta> for Phi
impl AddAssign<Delta> for Phi
source§fn add_assign(&mut self, rhs: Delta)
fn add_assign(&mut self, rhs: Delta)
Performs the
+= operation. Read moresource§impl AddAssign for Delta
impl AddAssign for Delta
source§fn add_assign(&mut self, rhs: Delta)
fn add_assign(&mut self, rhs: Delta)
Performs the
+= operation. Read moresource§impl<'de> Deserialize<'de> for Delta
impl<'de> Deserialize<'de> for Delta
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Delta, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Delta, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for Delta
impl PartialEq for Delta
source§impl PartialOrd for Delta
impl PartialOrd for Delta
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 Delta
impl Serialize for Delta
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
source§impl SubAssign<Delta> for Phi
impl SubAssign<Delta> for Phi
source§fn sub_assign(&mut self, rhs: Delta)
fn sub_assign(&mut self, rhs: Delta)
Performs the
-= operation. Read moresource§impl SubAssign for Delta
impl SubAssign for Delta
source§fn sub_assign(&mut self, rhs: Delta)
fn sub_assign(&mut self, rhs: Delta)
Performs the
-= operation. Read moreimpl Copy for Delta
impl StructuralPartialEq for Delta
Auto Trait Implementations§
impl Freeze for Delta
impl RefUnwindSafe for Delta
impl Send for Delta
impl Sync for Delta
impl Unpin for Delta
impl UnwindSafe for Delta
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