pub struct Speed { /* private fields */ }Expand description
Maximum travel speed (always non-negative, distance units per second).
Distance unit follows whatever the host chose for Position —
the engine never converts. Display formats the bare numeric
value to two decimals; hosts suffix their own unit label.
§Arithmetic
Same saturating contract as Weight: Sub / SubAssign
clamp underflow to zero rather than producing a negative value
the constructor would reject.
let s = Speed::from(2.0);
assert_eq!(format!("{s}"), "2.00");Implementations§
Trait Implementations§
Source§impl AddAssign for Speed
impl AddAssign for Speed
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl<'de> Deserialize<'de> for Speed
impl<'de> Deserialize<'de> for Speed
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 PartialOrd for Speed
impl PartialOrd for Speed
Source§impl SubAssign for Speed
impl SubAssign for Speed
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreimpl Copy for Speed
impl StructuralPartialEq for Speed
Auto Trait Implementations§
impl Freeze for Speed
impl RefUnwindSafe for Speed
impl Send for Speed
impl Sync for Speed
impl Unpin for Speed
impl UnsafeUnpin for Speed
impl UnwindSafe for Speed
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