Struct measurements::force::Force
[−]
[src]
pub struct Force { /* fields omitted */ }
The Force
struct can be used to deal with force in a common way.
#Example
use measurements::Force; use measurements::Mass; use measurements::Acceleration; let metric_ton = Mass::from_metric_tons(1.0); let gravity = Acceleration::from_meters_per_second_per_second(9.81); let force: Force = metric_ton * gravity; // F=ma println!( "One metric ton exerts a force of {} due to gravity", force);
Methods
impl Force
[src]
pub fn from_newtons(newtons: f64) -> Self
[src]
Create a Force from a floating point value in Newtons
pub fn from_micronewtons(micronewtons: f64) -> Self
[src]
Create a Force from a floating point value in Micronewtons
pub fn from_millinewtons(millinewtons: f64) -> Self
[src]
Create a Force from a floating point value in Millinewtons
pub fn from_pounds(pounds: f64) -> Self
[src]
Create a Force from a floating point value in pounds
pub fn from_poundals(poundals: f64) -> Self
[src]
Create a Force from a floating point value in poundals
pub fn from_kiloponds(kiloponds: f64) -> Self
[src]
Create a Force from a floating point value in kiloponds
pub fn from_dynes(dynes: f64) -> Self
[src]
Create a Force from a floating point value in Dynes
pub fn as_micronewtons(&self) -> f64
[src]
Convert this Force into a floating point value in Micronewtons
pub fn as_millinewtons(&self) -> f64
[src]
Convert this Force into a floating point value in Milliewtons
pub fn as_newtons(&self) -> f64
[src]
Convert this Force into a floating point value in Newtons
pub fn as_pounds(&self) -> f64
[src]
Convert this Force into a floating point value in pound-force (lb.f)
pub fn as_poundals(&self) -> f64
[src]
Convert this Force into a floating point value in poundals
pub fn as_kiloponds(&self) -> f64
[src]
Convert this Force into a floating point value in kiloponds
pub fn as_dynes(&self) -> f64
[src]
Convert this Force into a floating point value in dynes
Trait Implementations
impl Copy for Force
[src]
impl Clone for Force
[src]
fn clone(&self) -> Force
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Force
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Measurement for Force
[src]
fn as_base_units(&self) -> f64
[src]
Get this quantity in the base units
fn from_base_units(units: f64) -> Self
[src]
Create a new quantity from the base units
fn get_base_units_name(&self) -> &'static str
[src]
Return the base unit for this type, as a string. For example "kilograms" Read more
fn get_appropriate_units(&self) -> (&'static str, f64)
[src]
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
fn pick_appropriate_units(
&self,
list: &[(&'static str, f64)]
) -> (&'static str, f64)
[src]
&self,
list: &[(&'static str, f64)]
) -> (&'static str, f64)
Given a list of units and their scale relative to the base unit, select the most appropriate one. Read more
impl Display for Force
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Add for Force
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self
[src]
Performs the +
operation.
impl Sub for Force
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: Self) -> Self
[src]
Performs the -
operation.
impl Div<Force> for Force
[src]
type Output = f64
The resulting type after applying the /
operator.
fn div(self, rhs: Self) -> f64
[src]
Performs the /
operation.
impl Div<f64> for Force
[src]
type Output = Self
The resulting type after applying the /
operator.
fn div(self, rhs: f64) -> Self
[src]
Performs the /
operation.
impl Mul<f64> for Force
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: f64) -> Self
[src]
Performs the *
operation.
impl Mul<Force> for f64
[src]
type Output = Force
The resulting type after applying the *
operator.
fn mul(self, rhs: Force) -> Force
[src]
Performs the *
operation.
impl Eq for Force
[src]
impl PartialEq for Force
[src]
fn eq(&self, other: &Self) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl PartialOrd for Force
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Div<Acceleration> for Force
[src]
type Output = Mass
The resulting type after applying the /
operator.
fn div(self, rhs: Acceleration) -> Self::Output
[src]
Performs the /
operation.
impl Div<Mass> for Force
[src]
type Output = Acceleration
The resulting type after applying the /
operator.
fn div(self, rhs: Mass) -> Self::Output
[src]
Performs the /
operation.
impl Div<Area> for Force
[src]
type Output = Pressure
The resulting type after applying the /
operator.
fn div(self, rhs: Area) -> Self::Output
[src]
Performs the /
operation.
impl Div<Pressure> for Force
[src]
type Output = Area
The resulting type after applying the /
operator.
fn div(self, rhs: Pressure) -> Self::Output
[src]
Performs the /
operation.
impl Mul<Force> for Speed
[src]
type Output = Power
The resulting type after applying the *
operator.
fn mul(self, rhs: Force) -> Self::Output
[src]
Performs the *
operation.
impl Mul<Speed> for Force
[src]
type Output = Power
The resulting type after applying the *
operator.
fn mul(self, rhs: Speed) -> Self::Output
[src]
Performs the *
operation.
impl Div<Force> for Power
[src]
type Output = Speed
The resulting type after applying the /
operator.
fn div(self, rhs: Force) -> Self::Output
[src]
Performs the /
operation.
impl Mul<Force> for Length
[src]
type Output = TorqueEnergy
The resulting type after applying the *
operator.
fn mul(self, rhs: Force) -> Self::Output
[src]
Performs the *
operation.
impl Mul<Length> for Force
[src]
type Output = TorqueEnergy
The resulting type after applying the *
operator.
fn mul(self, rhs: Length) -> Self::Output
[src]
Performs the *
operation.
impl Div<Force> for TorqueEnergy
[src]
type Output = Length
The resulting type after applying the /
operator.
fn div(self, rhs: Force) -> Self::Output
[src]
Performs the /
operation.
impl Div<Force> for Torque
[src]
type Output = Length
The resulting type after applying the /
operator.
fn div(self, rhs: Force) -> Self::Output
[src]
Performs the /
operation.