Struct measurements::resistance::Resistance[][src]

pub struct Resistance { /* fields omitted */ }

The Resistance struct can be used to deal with electrical resistance in a common way.

Example

use measurements::Resistance;

let r = Resistance::from_kiloohms(4.7);
let o = r.as_ohms();
let mo = r.as_megaohms();
println!("A 4.7 kΩ resistor has {} Ω or {} MΩ", o, mo);

Methods

impl Resistance
[src]

Create a new Resistance from a floating point value in ohms

Create a new Resistance from a floating point value in kiloohms

Create a new Resistance from a floating point value in milliohms

Convert this Resistance into a floating point value in ohms

Convert this Resistance into a floating point value in kiloohms

Convert this Resistance into a floating point value in milliohms

Trait Implementations

impl Copy for Resistance
[src]

impl Clone for Resistance
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Resistance
[src]

Formats the value using the given formatter. Read more

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

Formats the value using the given formatter. Read more

impl Add for Resistance
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl Sub for Resistance
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl Div<Resistance> for Resistance
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl Div<f64> for Resistance
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl Mul<f64> for Resistance
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Mul<Resistance> for f64
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Eq for Resistance
[src]

impl PartialEq for Resistance
[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 Resistance
[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<Resistance> for Current
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Mul<Current> for Resistance
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Div<Resistance> for Voltage
[src]

The resulting type after applying the / operator.

Performs the / operation.

Auto Trait Implementations

impl Send for Resistance

impl Sync for Resistance