pub struct Impulse(/* private fields */);Expand description
An impulse quantity, stored canonically in Newton-seconds (N*s).
§Construction
use space_units::prelude::*;
let j = Impulse::from_n_s(5000.0);
let j2 = Impulse::from_kn_s(5.0);§Supported units
| Constructor | Accessor | Unit |
|---|---|---|
from_n_s | in_n_s | Newton-second (N*s) |
from_kn_s | in_kn_s | kN*s |
from_lbf_s | in_lbf_s | pound-force-second |
§Typed arithmetic
Implementations§
Source§impl Impulse
impl Impulse
Sourcepub const fn from_lbf_s(val: f64) -> Self
pub const fn from_lbf_s(val: f64) -> Self
Create from pound-force-seconds. 1 lbfs = 4.448 222 Ns.
Sourcepub fn in_unit(self, unit: ImpulseUnit) -> f64
pub fn in_unit(self, unit: ImpulseUnit) -> f64
Get value in the specified ImpulseUnit.
Sourcepub fn display_as(self, unit: ImpulseUnit) -> DisplayWithUnit
pub fn display_as(self, unit: ImpulseUnit) -> DisplayWithUnit
Return a DisplayWithUnit for formatted printing in the given unit.
Trait Implementations§
Source§impl AddAssign for Impulse
impl AddAssign for Impulse
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl DivAssign<f64> for Impulse
impl DivAssign<f64> for Impulse
Source§fn div_assign(&mut self, rhs: f64)
fn div_assign(&mut self, rhs: f64)
Performs the
/= operation. Read moreSource§impl MulAssign<f64> for Impulse
impl MulAssign<f64> for Impulse
Source§fn mul_assign(&mut self, rhs: f64)
fn mul_assign(&mut self, rhs: f64)
Performs the
*= operation. Read moreSource§impl PartialOrd for Impulse
impl PartialOrd for Impulse
Source§impl SubAssign for Impulse
impl SubAssign for Impulse
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreimpl Copy for Impulse
impl StructuralPartialEq for Impulse
Auto Trait Implementations§
impl Freeze for Impulse
impl RefUnwindSafe for Impulse
impl Send for Impulse
impl Sync for Impulse
impl Unpin for Impulse
impl UnsafeUnpin for Impulse
impl UnwindSafe for Impulse
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