Struct measurements::resistance::Resistance
source · [−]pub struct Resistance { /* private fields */ }
Expand description
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);
Implementations
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 kiloohms
Convert this Resistance into a floating point value in milliohms
Trait Implementations
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
type Output = Resistance
type Output = Resistance
The resulting type after applying the *
operator.
Performs the *
operation. Read more
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
Auto Trait Implementations
impl RefUnwindSafe for Resistance
impl Send for Resistance
impl Sync for Resistance
impl Unpin for Resistance
impl UnwindSafe for Resistance
Blanket Implementations
Mutably borrows from an owned value. Read more