Struct measurements::torque::Torque
source · [−]pub struct Torque { /* private fields */ }
Expand description
The ‘Torque’ struct can be used to deal with torque in a common way.
Example
use measurements::Torque;
let engine_torque = Torque::from_pound_foot(250.0);
println!("In metric, that's {} Nm", engine_torque.as_newton_metres());
Implementations
sourceimpl Torque
impl Torque
sourcepub fn from_newton_metres(newton_metres: f64) -> Self
pub fn from_newton_metres(newton_metres: f64) -> Self
Create a new Torque from a floating point value in newton metres
sourcepub fn from_newton_meters(newton_meters: f64) -> Self
pub fn from_newton_meters(newton_meters: f64) -> Self
Create a new Torque from a floating point value in newton meters
sourcepub fn from_pound_foot(pound_foot: f64) -> Self
pub fn from_pound_foot(pound_foot: f64) -> Self
Create a new Torque from a floating point value in pound-foot (lbf.ft)
sourcepub fn as_newton_metres(&self) -> f64
pub fn as_newton_metres(&self) -> f64
Convert this Torque to a floating point value in newton metres
sourcepub fn as_newton_meters(&self) -> f64
pub fn as_newton_meters(&self) -> f64
Convert this Torque to a floating point value in newton meters
sourcepub fn as_pound_foot(&self) -> f64
pub fn as_pound_foot(&self) -> f64
Convert this Torque to a floating point value in pound-foot (lbf-ft)
Trait Implementations
sourceimpl From<TorqueEnergy> for Torque
impl From<TorqueEnergy> for Torque
sourcefn from(t: TorqueEnergy) -> Torque
fn from(t: TorqueEnergy) -> Torque
Performs the conversion.
sourceimpl Measurement for Torque
impl Measurement for Torque
sourcefn as_base_units(&self) -> f64
fn as_base_units(&self) -> f64
Get this quantity in the base units
sourcefn from_base_units(units: f64) -> Self
fn from_base_units(units: f64) -> Self
Create a new quantity from the base units
sourcefn get_base_units_name(&self) -> &'static str
fn get_base_units_name(&self) -> &'static str
Return the base unit for this type, as a string. For example “kilograms” Read more
sourcefn get_appropriate_units(&self) -> (&'static str, f64)
fn get_appropriate_units(&self) -> (&'static str, f64)
Returns a string containing the most appropriate units for this quantity, and a floating point value representing this quantity in those units. Useful when, for example, a length might be in millimeters if it is very small, or kilometers when it is very large. Read more
sourceimpl Mul<AngularVelocity> for Torque
impl Mul<AngularVelocity> for Torque
sourceimpl Mul<Torque> for AngularVelocity
impl Mul<Torque> for AngularVelocity
sourceimpl PartialOrd<Torque> for Torque
impl PartialOrd<Torque> for Torque
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl Copy for Torque
impl Eq for Torque
Auto Trait Implementations
impl RefUnwindSafe for Torque
impl Send for Torque
impl Sync for Torque
impl Unpin for Torque
impl UnwindSafe for Torque
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more