Struct measurements::acceleration::Acceleration[][src]

pub struct Acceleration { /* fields omitted */ }

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

Example

extern crate measurements;
use measurements::{Acceleration, Length, Speed};
use std::time::Duration;

fn main() {
    // Standing quarter mile in 10.0 dead, at 120.0 mph
    let track = Length::from_miles(0.25);
    let finish = Speed::from_miles_per_hour(120.0);
    let time = Duration::new(10, 0);
    let accel: Acceleration = finish / time;
    println!("You accelerated over {} at an average of {}", track, accel);
}

Methods

impl Acceleration
[src]

Create a new Acceleration from a floating point value in meters per second per second

Create a new Acceleration from a floating point value in metres per second per second

Create a new Acceleration from a floating point value in feet per second per second

Convert this Acceleration to a value in meters per second per second

Convert this Acceleration to a value in metres per second per second

Convert this Acceleration to a value in feet per second per second

Trait Implementations

impl Copy for Acceleration
[src]

impl Clone for Acceleration
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Acceleration
[src]

Formats the value using the given formatter. Read more

impl Measurement for Acceleration
[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 Acceleration
[src]

Formats the value using the given formatter. Read more

impl Add for Acceleration
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl Sub for Acceleration
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl Div<Acceleration> for Acceleration
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl Div<f64> for Acceleration
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl Mul<f64> for Acceleration
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Mul<Acceleration> for f64
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Eq for Acceleration
[src]

impl PartialEq for Acceleration
[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 Acceleration
[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<Mass> for Acceleration
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Mul<Acceleration> for Mass
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Div<Acceleration> for Force
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl Mul<Duration> for Acceleration
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Mul<Acceleration> for Duration
[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.

Auto Trait Implementations