Enum TimeUnit

Source
pub enum TimeUnit {
Show 31 variants yottasecond, zettasecond, exasecond, petasecond, terasecond, gigasecond, megasecond, kilosecond, hectosecond, decasecond, second, decisecond, centisecond, millisecond, microsecond, nanosecond, picosecond, femtosecond, attosecond, zeptosecond, yoctosecond, second_sidereal, day, day_sidereal, hour, hour_sidereal, minute, shake, year, year_sidereal, year_tropical,
}
Expand description

Time (base UnitDefinition second, s).

Variants§

§

yottasecond

§

zettasecond

§

exasecond

§

petasecond

§

terasecond

§

gigasecond

§

megasecond

§

kilosecond

§

hectosecond

§

decasecond

§

second

§

decisecond

§

centisecond

§

millisecond

§

microsecond

§

nanosecond

§

picosecond

§

femtosecond

§

attosecond

§

zeptosecond

§

yoctosecond

§

second_sidereal

§

day

§

day_sidereal

§

hour

§

hour_sidereal

§

minute

§

shake

§

year

§

year_sidereal

§

year_tropical

Implementations§

Source§

impl TimeUnit

Source

pub fn get_yottasecond() -> UnitDefinition

Source

pub fn get_zettasecond() -> UnitDefinition

Source

pub fn get_exasecond() -> UnitDefinition

Source

pub fn get_petasecond() -> UnitDefinition

Source

pub fn get_terasecond() -> UnitDefinition

Source

pub fn get_gigasecond() -> UnitDefinition

Source

pub fn get_megasecond() -> UnitDefinition

Source

pub fn get_kilosecond() -> UnitDefinition

Source

pub fn get_hectosecond() -> UnitDefinition

Source

pub fn get_decasecond() -> UnitDefinition

Source

pub fn get_second() -> UnitDefinition

Source

pub fn get_decisecond() -> UnitDefinition

Source

pub fn get_centisecond() -> UnitDefinition

Source

pub fn get_millisecond() -> UnitDefinition

Source

pub fn get_microsecond() -> UnitDefinition

Source

pub fn get_nanosecond() -> UnitDefinition

Source

pub fn get_picosecond() -> UnitDefinition

Source

pub fn get_femtosecond() -> UnitDefinition

Source

pub fn get_attosecond() -> UnitDefinition

Source

pub fn get_zeptosecond() -> UnitDefinition

Source

pub fn get_yoctosecond() -> UnitDefinition

Source

pub fn get_second_sidereal() -> UnitDefinition

Source

pub fn get_day() -> UnitDefinition

Source

pub fn get_day_sidereal() -> UnitDefinition

Source

pub fn get_hour() -> UnitDefinition

Source

pub fn get_hour_sidereal() -> UnitDefinition

Source

pub fn get_minute() -> UnitDefinition

Source

pub fn get_shake() -> UnitDefinition

Source

pub fn get_year() -> UnitDefinition

Source

pub fn get_year_sidereal() -> UnitDefinition

Source

pub fn get_year_tropical() -> UnitDefinition

Source

pub const fn multiplier(&self) -> f64

Multiplier of unit to its base quantity.

Source

pub fn abbreviation(&self) -> &'static str

Abbreviation of unit.

Source

pub fn singular(&self) -> &'static str

Singular name of unit.

Source

pub fn plural(&self) -> &'static str

Plural name of unit.

Source

pub fn units() -> &'static [&'static str]

Available units for this [TimeUnit].

Trait Implementations§

Source§

impl Clone for TimeUnit

Source§

fn clone(&self) -> TimeUnit

Returns a copy 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 TimeUnit

Source§

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

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

impl Default for TimeUnit

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for TimeUnit

Source§

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

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

impl FixedQuantity<TimeUnit> for Time

Source§

fn unit(&self) -> TimeUnit

Return unit associated with this quantity
Source§

fn convert(&self, unit: TimeUnit) -> Self

Convert from this unit to another (creates a copy). No validation of base unit is made.
Source§

fn convert_mut(&mut self, unit: TimeUnit)

Convert from this unit to another (modifies current quantity). No validation of base unit is made.
Source§

fn unit_mut(&mut self) -> &mut TimeUnit

Return mutable unit associated with this quantity
Source§

fn try_convert(&self, unit: Units) -> Result<Self, RuntimeUnitError>
where Self: Sized,

Try to convert from this unit to another (creates a copy)
Source§

impl<const N: usize> FixedSliceQuantity<TimeUnit, f64> for TimeArray<N>

Source§

fn unit(&self) -> TimeUnit

Return unit associated with this quantity
Source§

fn values(&self) -> &[f64]

Return values in quantity
Source§

fn values_mut(&mut self) -> &mut [f64]

Return mutable values in quantity
Source§

fn len(&self) -> usize

Return number of values in quantity
Source§

fn convert(&self, unit: TimeUnit) -> Self

Convert a unit of one UnitType to another of the same type. No validation of base unit is made.
Source§

fn convert_mut(&mut self, unit: TimeUnit)

Mutate current quantity, convering a unit of one UnitType to another of the same type. No validation of base unit is made.
Source§

fn try_convert(&self, unit: Units) -> Result<Self, RuntimeUnitError>
where Self: Sized,

Attempt to convert the unit given in unit to a UnitType. Base unit validation is made here.
Source§

impl FixedSliceQuantity<TimeUnit, f64> for TimeVec

Source§

fn unit(&self) -> TimeUnit

Return unit associated with this quantity
Source§

fn values(&self) -> &[f64]

Return values in quantity
Source§

fn values_mut(&mut self) -> &mut [f64]

Return mutable values in quantity
Source§

fn len(&self) -> usize

Return number of values in quantity
Source§

fn convert(&self, unit: TimeUnit) -> Self

Convert a unit of one UnitType to another of the same type. No validation of base unit is made.
Source§

fn convert_mut(&mut self, unit: TimeUnit)

Mutate current quantity, convering a unit of one UnitType to another of the same type. No validation of base unit is made.
Source§

fn try_convert(&self, unit: Units) -> Result<Self, RuntimeUnitError>
where Self: Sized,

Attempt to convert the unit given in unit to a UnitType. Base unit validation is made here.
Source§

impl From<TimeUnit> for UnitDefinition

Source§

fn from(value: TimeUnit) -> Self

Converts to this type from the input type.
Source§

impl From<TimeUnit> for Units

Source§

fn from(value: TimeUnit) -> Self

Converts to this type from the input type.
Source§

impl Hash for TimeUnit

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for TimeUnit

Source§

fn eq(&self, other: &TimeUnit) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<&str> for TimeUnit

Source§

type Error = &'static str

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

fn try_from(value: &str) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<UnitDefinition> for TimeUnit

Source§

type Error = RuntimeUnitError

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

fn try_from(value: UnitDefinition) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Units> for TimeUnit

Source§

type Error = RuntimeUnitError

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

fn try_from(value: Units) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Unit for TimeUnit

Source§

fn definition(&self) -> UnitDefinition

Return unit definition for this Unit Type

Source§

fn base() -> UnitBase

Base unit definition
Source§

fn base_unit() -> Self

Base unit for this unit type (e.g. meter for LengthUnit)
Source§

fn try_convert(&self, unit: UnitDefinition) -> Result<f64, RuntimeUnitError>

Try to compute conversion factor from this unit to another.
Source§

fn convert_unchecked(&self, unit: Self) -> f64

Compute conversion factor from this unit to another (no check of unit compatibility is made).
Source§

impl Copy for TimeUnit

Source§

impl Eq for TimeUnit

Source§

impl StructuralPartialEq for TimeUnit

Auto Trait Implementations§

Blanket Implementations§

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> 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<T> CloneToUninit for T
where T: Clone,

Source§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> 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.