pub struct Weight { /* private fields */ }Expand description
Weight / mass (always non-negative).
Used for rider weight, elevator load, and weight capacity.
let w = Weight::from(75.0);
assert_eq!(w.value(), 75.0);
assert_eq!(format!("{w}"), "75.00kg");Implementations§
Trait Implementations§
Source§impl AddAssign for Weight
impl AddAssign for Weight
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 Weight
impl<'de> Deserialize<'de> for Weight
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 Weight
impl PartialOrd for Weight
Source§impl SubAssign for Weight
impl SubAssign for Weight
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreimpl Copy for Weight
impl StructuralPartialEq for Weight
Auto Trait Implementations§
impl Freeze for Weight
impl RefUnwindSafe for Weight
impl Send for Weight
impl Sync for Weight
impl Unpin for Weight
impl UnsafeUnpin for Weight
impl UnwindSafe for Weight
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