Power

Struct Power 

Source
pub struct Power {
    pub m: Magnitude,
}
Available on crate feature alloc only.
Expand description

How quickly the Energy is transferred, or the Work is done, in W (watts).

Fields§

§m: Magnitude

Implementations§

Source§

impl Power

Source

pub const fn new(m: Magnitude) -> Self

New Power.

Source

pub const fn m(&self) -> Magnitude

Returns the magnitude.

Source§

impl Power

Formulas

Source

pub fn from_energy_time(e: Energy, t: Time) -> Self

Derives the Power from the given Energy and Time (P = E / t).

Source

pub fn from_time_energy(t: Time, e: Energy) -> Self

(Alias of from_energy_time).

Source

pub fn calc_energy(&self, t: Time) -> Energy

Calculates the Energy given the Time (E = P × t).

Source

pub fn calc_time(&self, e: Energy) -> Time

Calculates the Time given the Energy (t = E / P).

Source§

impl Power

§SI prefixes constructors: in_* & converters as_*

The Power quantity is internally stored in watts (W).

Source

pub fn in_QW(m: Magnitude) -> Self

New Power in quettawatts (QW) (10³⁰ W).

Source

pub fn in_quettawatts(m: Magnitude) -> Self

New Power in quettawatts (QW) (10³⁰ W).

Source

pub fn as_QW(&self) -> Magnitude

Returns Power as quettawatts (QW) (10³⁰ W).

Source

pub fn as_quettawatts(&self) -> Magnitude

Returns Power as quettawatts (QW) (10³⁰ W).

Source

pub fn in_RW(m: Magnitude) -> Self

New Power in ronnawatts (RW) (10²⁷ W).

Source

pub fn in_ronnawatts(m: Magnitude) -> Self

New Power in ronnawatts (RW) (10²⁷ W).

Source

pub fn as_RW(&self) -> Magnitude

Returns Power as ronnawatts (RW) (10²⁷ W).

Source

pub fn as_ronnawatts(&self) -> Magnitude

Returns Power as ronnawatts (RW) (10²⁷ W).

Source

pub fn in_YW(m: Magnitude) -> Self

New Power in yottawatts (YW) (10²⁴ W).

Source

pub fn in_yottawatts(m: Magnitude) -> Self

New Power in yottawatts (YW) (10²⁴ W).

Source

pub fn as_YW(&self) -> Magnitude

Returns Power as yottawatts (YW) (10²⁴ W).

Source

pub fn as_yottawatts(&self) -> Magnitude

Returns Power as yottawatts (YW) (10²⁴ W).

Source

pub fn in_ZW(m: Magnitude) -> Self

New Power in zettawatts (ZW) (10²¹ W).

Source

pub fn in_zettawatts(m: Magnitude) -> Self

New Power in zettawatts (ZW) (10²¹ W).

Source

pub fn as_ZW(&self) -> Magnitude

Returns Power as zettawatts (ZW) (10²¹ W).

Source

pub fn as_zettawatts(&self) -> Magnitude

Returns Power as zettawatts (ZW) (10²¹ W).

Source

pub fn in_EW(m: Magnitude) -> Self

New Power in exawatts (EW) (10¹⁸ W).

Source

pub fn in_exawatts(m: Magnitude) -> Self

New Power in exawatts (EW) (10¹⁸ W).

Source

pub fn as_EW(&self) -> Magnitude

Returns Power as exawatts (EW) (10¹⁸ W).

Source

pub fn as_exawatts(&self) -> Magnitude

Returns Power as exawatts (EW) (10¹⁸ W).

Source

pub fn in_PW(m: Magnitude) -> Self

New Power in petawatts (PW) (10¹⁵ W).

Source

pub fn in_petawatts(m: Magnitude) -> Self

New Power in petawatts (PW) (10¹⁵ W).

Source

pub fn as_PW(&self) -> Magnitude

Returns Power as petawatts (PW) (10¹⁵ W).

Source

pub fn as_petawatts(&self) -> Magnitude

Returns Power as petawatts (PW) (10¹⁵ W).

Source

pub fn in_TW(m: Magnitude) -> Self

New Power in terawatts (TW) (10¹² W).

Source

pub fn in_terawatts(m: Magnitude) -> Self

New Power in terawatts (TW) (10¹² W).

Source

pub fn as_TW(&self) -> Magnitude

Returns Power as terawatts (TW) (10¹² W).

Source

pub fn as_terawatts(&self) -> Magnitude

Returns Power as terawatts (TW) (10¹² W).

Source

pub fn in_GW(m: Magnitude) -> Self

New Power in gigawatts (GW) (10⁹ W).

Source

pub fn in_gigawatts(m: Magnitude) -> Self

New Power in gigawatts (GW) (10⁹ W).

Source

pub fn as_GW(&self) -> Magnitude

Returns Power as gigawatts (GW) (10⁹ W).

Source

pub fn as_gigawatts(&self) -> Magnitude

Returns Power as gigawatts (GW) (10⁹ W).

Source

pub fn in_MW(m: Magnitude) -> Self

New Power in megawatts (MW) (10⁶ W).

Source

pub fn in_megawatts(m: Magnitude) -> Self

New Power in megawatts (MW) (10⁶ W).

Source

pub fn as_MW(&self) -> Magnitude

Returns Power as megawatts (MW) (10⁶ W).

Source

pub fn as_megawatts(&self) -> Magnitude

Returns Power as megawatts (MW) (10⁶ W).

Source

pub fn in_kW(m: Magnitude) -> Self

New Power in kilowatts (kW) (10³ W).

Source

pub fn in_kilowatts(m: Magnitude) -> Self

New Power in kilowatts (kW) (10³ W).

Source

pub fn as_kW(&self) -> Magnitude

Returns Power as kilowatts (kW) (10³ W).

Source

pub fn as_kilowatts(&self) -> Magnitude

Returns Power as kilowatts (kW) (10³ W).

Source

pub fn in_hW(m: Magnitude) -> Self

New Power in hectowatts (hW) (10² W).

Source

pub fn in_hectowatts(m: Magnitude) -> Self

New Power in hectowatts (hW) (10² W).

Source

pub fn as_hW(&self) -> Magnitude

Returns Power as hectowatts (hW) (10² W).

Source

pub fn as_hectowatts(&self) -> Magnitude

Returns Power as hectowatts (hW) (10² W).

Source

pub fn in_daW(m: Magnitude) -> Self

New Power in dekawatts (daW) (10¹ W).

Source

pub fn in_dekawatts(m: Magnitude) -> Self

New Power in dekawatts (daW) (10¹ W).

Source

pub fn as_daW(&self) -> Magnitude

Returns Power as dekawatts (daW) (10¹ W).

Source

pub fn as_dekawatts(&self) -> Magnitude

Returns Power as dekawatts (daW) (10¹ W).

Source

pub const fn in_W(m: Magnitude) -> Self

New Power in watts (W) (base unit, 10⁰ W).

Source

pub const fn in_watts(m: Magnitude) -> Self

New Power in watts (W) (base unit, 10⁰ W).

Source

pub const fn as_W(&self) -> Magnitude

Returns Power as watts (W) (base unit, 10⁰ W).

Source

pub const fn as_watts(&self) -> Magnitude

Returns Power as watts (W) (base unit, 10⁰ W).

Source

pub fn in_dW(m: Magnitude) -> Self

New Power in deciwatts (dW) (10⁻¹ W).

Source

pub fn in_deciwatts(m: Magnitude) -> Self

New Power in deciwatts (dW) (10⁻¹ W).

Source

pub fn as_dW(&self) -> Magnitude

Returns Power as deciwatts (dW) (10⁻¹ W).

Source

pub fn as_deciwatts(&self) -> Magnitude

Returns Power as deciwatts (dW) (10⁻¹ W).

Source

pub fn in_cW(m: Magnitude) -> Self

New Power in centiwatts (cW) (10⁻² W).

Source

pub fn in_centiwatts(m: Magnitude) -> Self

New Power in centiwatts (cW) (10⁻² W).

Source

pub fn as_cW(&self) -> Magnitude

Returns Power as centiwatts (cW) (10⁻² W).

Source

pub fn as_centiwatts(&self) -> Magnitude

Returns Power as centiwatts (cW) (10⁻² W).

Source

pub fn in_mW(m: Magnitude) -> Self

New Power in milliwatts (mW) (10⁻³ W).

Source

pub fn in_milliwatts(m: Magnitude) -> Self

New Power in milliwatts (mW) (10⁻³ W).

Source

pub fn as_mW(&self) -> Magnitude

Returns Power as milliwatts (mW) (10⁻³ W).

Source

pub fn as_milliwatts(&self) -> Magnitude

Returns Power as milliwatts (mW) (10⁻³ W).

Source

pub fn in_uW(m: Magnitude) -> Self

New Power in microwatts (uW) (10⁻⁶ W).

Source

pub fn in_microwatts(m: Magnitude) -> Self

New Power in microwatts (uW) (10⁻⁶ W).

Source

pub fn as_uW(&self) -> Magnitude

Returns Power as microwatts (uW) (10⁻⁶ W).

Source

pub fn as_microwatts(&self) -> Magnitude

Returns Power as microwatts (uW) (10⁻⁶ W).

Source

pub fn in_nW(m: Magnitude) -> Self

New Power in nanowatts (nW) (10⁻⁹ W).

Source

pub fn in_nanowatts(m: Magnitude) -> Self

New Power in nanowatts (nW) (10⁻⁹ W).

Source

pub fn as_nW(&self) -> Magnitude

Returns Power as nanowatts (nW) (10⁻⁹ W).

Source

pub fn as_nanowatts(&self) -> Magnitude

Returns Power as nanowatts (nW) (10⁻⁹ W).

Source

pub fn in_pW(m: Magnitude) -> Self

New Power in picowatts (pW) (10⁻¹² W).

Source

pub fn in_picowatts(m: Magnitude) -> Self

New Power in picowatts (pW) (10⁻¹² W).

Source

pub fn as_pW(&self) -> Magnitude

Returns Power as picowatts (pW) (10⁻¹² W).

Source

pub fn as_picowatts(&self) -> Magnitude

Returns Power as picowatts (pW) (10⁻¹² W).

Source

pub fn in_fW(m: Magnitude) -> Self

New Power in femtowatts (fW) (10⁻¹⁵ W).

Source

pub fn in_femtowatts(m: Magnitude) -> Self

New Power in femtowatts (fW) (10⁻¹⁵ W).

Source

pub fn as_fW(&self) -> Magnitude

Returns Power as femtowatts (fW) (10⁻¹⁵ W).

Source

pub fn as_femtowatts(&self) -> Magnitude

Returns Power as femtowatts (fW) (10⁻¹⁵ W).

Source

pub fn in_aW(m: Magnitude) -> Self

New Power in attowatts (aW) (10⁻¹⁸ W).

Source

pub fn in_attowatts(m: Magnitude) -> Self

New Power in attowatts (aW) (10⁻¹⁸ W).

Source

pub fn as_aW(&self) -> Magnitude

Returns Power as attowatts (aW) (10⁻¹⁸ W).

Source

pub fn as_attowatts(&self) -> Magnitude

Returns Power as attowatts (aW) (10⁻¹⁸ W).

Source

pub fn in_zW(m: Magnitude) -> Self

New Power in zeptowatts (zW) (10⁻²¹ W).

Source

pub fn in_zeptowatts(m: Magnitude) -> Self

New Power in zeptowatts (zW) (10⁻²¹ W).

Source

pub fn as_zW(&self) -> Magnitude

Returns Power as zeptowatts (zW) (10⁻²¹ W).

Source

pub fn as_zeptowatts(&self) -> Magnitude

Returns Power as zeptowatts (zW) (10⁻²¹ W).

Source

pub fn in_yW(m: Magnitude) -> Self

New Power in yoctowatts (yW) (10⁻²⁴ W).

Source

pub fn in_yoctowatts(m: Magnitude) -> Self

New Power in yoctowatts (yW) (10⁻²⁴ W).

Source

pub fn as_yW(&self) -> Magnitude

Returns Power as yoctowatts (yW) (10⁻²⁴ W).

Source

pub fn as_yoctowatts(&self) -> Magnitude

Returns Power as yoctowatts (yW) (10⁻²⁴ W).

Source

pub fn in_rW(m: Magnitude) -> Self

New Power in rontowatts (rW) (10⁻²⁷ W).

Source

pub fn in_rontowatts(m: Magnitude) -> Self

New Power in rontowatts (rW) (10⁻²⁷ W).

Source

pub fn as_rW(&self) -> Magnitude

Returns Power as rontowatts (rW) (10⁻²⁷ W).

Source

pub fn as_rontowatts(&self) -> Magnitude

Returns Power as rontowatts (rW) (10⁻²⁷ W).

Source

pub fn in_qW(m: Magnitude) -> Self

New Power in quectowatts (qW) (10⁻³⁰ W).

Source

pub fn in_quectowatts(m: Magnitude) -> Self

New Power in quectowatts (qW) (10⁻³⁰ W).

Source

pub fn as_qW(&self) -> Magnitude

Returns Power as quectowatts (qW) (10⁻³⁰ W).

Source

pub fn as_quectowatts(&self) -> Magnitude

Returns Power as quectowatts (qW) (10⁻³⁰ W).

Trait Implementations§

Source§

impl Clone for Power

Source§

fn clone(&self) -> Power

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Power

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Power

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Unit for Power

Source§

fn unit() -> String

Returns the unit in short format.
Source§

fn unit_long_s(&self) -> String

Returns the unit in long format, singular.
Source§

fn unit_long_p(&self) -> String

Returns the unit in long format, plural.
Source§

fn unit_long(&self) -> String

Returns the unit in long format, singular if magnitude == 1, plural otherwise.
Source§

fn long(&self) -> String

Returns the unit and magnitude in long format.
Source§

impl Copy for Power

Auto Trait Implementations§

§

impl Freeze for Power

§

impl RefUnwindSafe for Power

§

impl Send for Power

§

impl Sync for Power

§

impl Unpin for Power

§

impl UnwindSafe for Power

Blanket Implementations§

Source§

impl<T> Also for T

Source§

fn also_mut<F>(self, f: F) -> Self
where F: FnOnce(&mut Self),

Applies a function which takes the parameter by exclusive reference, and then returns the (possibly) modified owned value. Read more
Source§

fn also_ref<F>(self, f: F) -> Self
where F: FnOnce(&Self),

Applies a function which takes the parameter by shared reference, and then returns the (possibly) modified owned value. Read more
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T, Res> Apply<Res> for T
where T: ?Sized,

Source§

fn apply<F>(self, f: F) -> Res
where F: FnOnce(Self) -> Res, Self: Sized,

Apply a function which takes the parameter by value.
Source§

fn apply_ref<F>(&self, f: F) -> Res
where F: FnOnce(&Self) -> Res,

Apply a function which takes the parameter by shared reference.
Source§

fn apply_mut<F>(&mut self, f: F) -> Res
where F: FnOnce(&mut Self) -> Res,

Apply a function which takes the parameter by exclusive reference.
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.