Struct sensehat::Temperature[][src]

pub struct Temperature { /* fields omitted */ }

The Temperature struct can be used to deal with absolute temperatures in a common way.

Example

use measurements::Temperature;

let boiling_water = Temperature::from_celsius(100.0);
let fahrenheit = boiling_water.as_fahrenheit();
println!("Boiling water measures at {} degrees fahrenheit.", fahrenheit);

Methods

impl Temperature
[src]

Create a new Temperature from a floating point value in Kelvin

Create a new Temperature from a floating point value in Celsius

Create a new Temperature from a floating point value in Fahrenheit

Create a new Temperature from a floating point value in Rankine

Convert this absolute Temperature to a floating point value in Kelvin

Convert this absolute Temperature to a floating point value in Celsius

Convert this absolute Temperature to a floating point value in Fahrenheit

Convert this absolute Temperature to a floating point value in Rankine

Trait Implementations

impl Add<Temperature> for TemperatureDelta
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl Add<TemperatureDelta> for Temperature
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl PartialOrd<Temperature> for Temperature
[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 Sub<Temperature> for Temperature
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl Sub<TemperatureDelta> for Temperature
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl Display for Temperature
[src]

Formats the value using the given formatter. Read more

impl Clone for Temperature
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Temperature
[src]

Formats the value using the given formatter. Read more

impl Copy for Temperature
[src]

impl Eq for Temperature
[src]

impl PartialEq<Temperature> for Temperature
[src]

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

This method tests for !=.

impl Measurement for Temperature
[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

Auto Trait Implementations

impl Send for Temperature

impl Sync for Temperature