pub struct Force(/* private fields */);Expand description
A force quantity, stored canonically in Newtons (N).
§Construction
use space_units::prelude::*;
let f = Force::from_kn(50.0);
let f2 = 50.0.kn(); // NumericExt shorthand§Supported units
| Constructor | Accessor | Unit |
|---|---|---|
from_n | in_n | Newton (N) |
from_kn | in_kn | kilonewton (kN) |
from_mn | in_mn | meganewton (MN) |
from_lbf | in_lbf | pound-force (lbf) |
from_dyn | in_dyn | dyne (dyn) |
§Typed arithmetic
Implementations§
Source§impl Force
impl Force
Sourcepub fn display_as(self, unit: ForceUnit) -> DisplayWithUnit
pub fn display_as(self, unit: ForceUnit) -> DisplayWithUnit
Return a DisplayWithUnit for formatted printing in the given unit.
Trait Implementations§
Source§impl AddAssign for Force
impl AddAssign for Force
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl Div<Acceleration> for Force
impl Div<Acceleration> for Force
Source§impl Div<Mass> for Force
impl Div<Mass> for Force
Source§type Output = Acceleration
type Output = Acceleration
The resulting type after applying the
/ operator.Source§impl Div<MassFlowRate> for Force
impl Div<MassFlowRate> for Force
Source§impl Div<Velocity> for Force
impl Div<Velocity> for Force
Source§type Output = MassFlowRate
type Output = MassFlowRate
The resulting type after applying the
/ operator.Source§impl DivAssign<f64> for Force
impl DivAssign<f64> for Force
Source§fn div_assign(&mut self, rhs: f64)
fn div_assign(&mut self, rhs: f64)
Performs the
/= operation. Read moreSource§impl MulAssign<f64> for Force
impl MulAssign<f64> for Force
Source§fn mul_assign(&mut self, rhs: f64)
fn mul_assign(&mut self, rhs: f64)
Performs the
*= operation. Read moreSource§impl PartialOrd for Force
impl PartialOrd for Force
Source§impl SubAssign for Force
impl SubAssign for Force
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreimpl Copy for Force
impl StructuralPartialEq for Force
Auto Trait Implementations§
impl Freeze for Force
impl RefUnwindSafe for Force
impl Send for Force
impl Sync for Force
impl Unpin for Force
impl UnsafeUnpin for Force
impl UnwindSafe for Force
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