Struct measurements::speed::Speed[][src]

pub struct Speed { /* fields omitted */ }

The Speed struct can be used to deal with speeds in a common way. Common metric and imperial units are supported.

Example

use measurements::Speed;

let light = Speed::from_meters_per_second(300_000_000.0);
let mph = light.as_miles_per_hour();
println!("The speed of light is {} mph.", mph);

Methods

impl Speed
[src]

Create a new Speed from a floating point number of m/s

Create a new Speed from a floating point number of m/s

Create a new Speed from a floating point number of km/h (kph)

Create a new Speed from a floating point number of km/h (kph)

Create a new Speed from a floating point number of miles/hour (mph)

Convert this speed to a floating point number of m/s

Convert this speed to a floating point number of m/s

Convert this speed to a floating point number of km/hour (kph)

Convert this speed to a floating point number of km/hour (kph)

Convert this speed to a floating point number of miles/hour (mph)

Trait Implementations

impl Copy for Speed
[src]

impl Clone for Speed
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Speed
[src]

Formats the value using the given formatter. Read more

impl Measurement for Speed
[src]

Get this quantity in the base units

Create a new quantity from the base units

Return the base unit for this type, as a string. For example "kilograms" Read more

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

Given a list of units and their scale relative to the base unit, select the most appropriate one. Read more

impl Display for Speed
[src]

Formats the value using the given formatter. Read more

impl Add for Speed
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl Sub for Speed
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl Div<Speed> for Speed
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl Div<f64> for Speed
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl Mul<f64> for Speed
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Mul<Speed> for f64
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Eq for Speed
[src]

impl PartialEq for Speed
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl PartialOrd for Speed
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Mul<Duration> for Speed
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Mul<Speed> for Duration
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Div<Speed> for Length
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl Mul<Force> for Speed
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Mul<Speed> for Force
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Div<Speed> for Power
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl Div<Acceleration> for Speed
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl Div<Duration> for Speed
[src]

The resulting type after applying the / operator.

Performs the / operation.

Auto Trait Implementations

impl Send for Speed

impl Sync for Speed