pub type TimeSplitYearSecNorm = TimeSplit<u64, u8, u8, u8, u8, u8, (), (), ()>;
Available on crate feature
time
only.Expand description
A time split from years to seconds, normalized (128b size, 104b payload).
Aliased Type§
struct TimeSplitYearSecNorm {
pub y: u64,
pub mo: u8,
pub d: u8,
pub h: u8,
pub m: u8,
pub s: u8,
pub ms: (),
pub us: (),
pub ns: (),
}
Fields§
§y: u64
Years.
mo: u8
Months.
d: u8
Days.
h: u8
Hours.
m: u8
Minutes.
s: u8
Seconds.
ms: ()
Milliseconds.
us: ()
Microseconds.
ns: ()
Nanoseconds.
Implementations§
Source§impl TimeSplitYearSecNorm
impl TimeSplitYearSecNorm
Sourcepub const fn from_duration(duration: Duration) -> Self
pub const fn from_duration(duration: Duration) -> Self
Converts a Duration
into a TimeSplitYearSec
.
It assumes non-leap years and 30-day months for simplicity in calendar calculations.
Source§impl<Y, MO, D, H, M, S> TimeSplit<Y, MO, D, H, M, S, (), (), ()>
impl<Y, MO, D, H, M, S> TimeSplit<Y, MO, D, H, M, S, (), (), ()>
Sourcepub const fn new_year_sec(y: Y, mo: MO, d: D, h: H, m: M, s: S) -> Self
pub const fn new_year_sec(y: Y, mo: MO, d: D, h: H, m: M, s: S) -> Self
Returns a new TimeSplitYearSec
.
Source§impl<Y, MO, D, H, M, S, MS, US, NS> TimeSplit<Y, MO, D, H, M, S, MS, US, NS>
§Structural introspection
impl<Y, MO, D, H, M, S, MS, US, NS> TimeSplit<Y, MO, D, H, M, S, MS, US, NS>
§Structural introspection
Sourcepub const IS_YEAR_DAY: bool
pub const IS_YEAR_DAY: bool
Sourcepub const IS_HOUR_SEC: bool
pub const IS_HOUR_SEC: bool
Sourcepub const IS_MILLI_NANO: bool
pub const IS_MILLI_NANO: bool
Sourcepub const IS_YEAR_SEC: bool
pub const IS_YEAR_SEC: bool
Sourcepub const IS_HOUR_NANO: bool
pub const IS_HOUR_NANO: bool
Sourcepub const IS_YEAR_NANO: bool = Self::Y_NS
pub const IS_YEAR_NANO: bool = Self::Y_NS
Source§impl<Y, MO, D, H, M, S, MS, US, NS> TimeSplit<Y, MO, D, H, M, S, MS, US, NS>
§Instance introspection
impl<Y, MO, D, H, M, S, MS, US, NS> TimeSplit<Y, MO, D, H, M, S, MS, US, NS>
§Instance introspection
Sourcepub const fn is_year_day(&self) -> bool
pub const fn is_year_day(&self) -> bool
Sourcepub const fn is_hour_sec(&self) -> bool
pub const fn is_hour_sec(&self) -> bool
Sourcepub const fn is_milli_nano(&self) -> bool
pub const fn is_milli_nano(&self) -> bool
Sourcepub const fn is_year_sec(&self) -> bool
pub const fn is_year_sec(&self) -> bool
Sourcepub const fn is_hour_nano(&self) -> bool
pub const fn is_hour_nano(&self) -> bool
Sourcepub const fn is_year_nano(&self) -> bool
pub const fn is_year_nano(&self) -> bool
Source§impl<Y, MO, D, H, M, S, MS, US, NS> TimeSplit<Y, MO, D, H, M, S, MS, US, NS>
impl<Y, MO, D, H, M, S, MS, US, NS> TimeSplit<Y, MO, D, H, M, S, MS, US, NS>
Sourcepub fn as_tuple(self) -> (Y, MO, D, H, M, S, MS, US, NS) ⓘ
pub fn as_tuple(self) -> (Y, MO, D, H, M, S, MS, US, NS) ⓘ
Returns a (9) tuple with all the elements.
Sourcepub const fn to_tuple(&self) -> (Y, MO, D, H, M, S, MS, US, NS) ⓘ
pub const fn to_tuple(&self) -> (Y, MO, D, H, M, S, MS, US, NS) ⓘ
Returns a (9) tuple with all the elements.
Sourcepub fn as_tuple_y_d(self) -> Option<(Y, MO, D)> ⓘ
pub fn as_tuple_y_d(self) -> Option<(Y, MO, D)> ⓘ
Sourcepub const fn to_tuple_y_d(&self) -> Option<(Y, MO, D)> ⓘ
pub const fn to_tuple_y_d(&self) -> Option<(Y, MO, D)> ⓘ
Sourcepub fn as_tuple_h_s(self) -> Option<(H, M, S)> ⓘ
pub fn as_tuple_h_s(self) -> Option<(H, M, S)> ⓘ
Sourcepub const fn to_tuple_h_s(&self) -> Option<(H, M, S)> ⓘ
pub const fn to_tuple_h_s(&self) -> Option<(H, M, S)> ⓘ
Sourcepub fn as_tuple_ms_ns(self) -> Option<(MS, US, NS)> ⓘ
pub fn as_tuple_ms_ns(self) -> Option<(MS, US, NS)> ⓘ
Sourcepub const fn to_tuple_ms_ns(&self) -> Option<(MS, US, NS)> ⓘ
pub const fn to_tuple_ms_ns(&self) -> Option<(MS, US, NS)> ⓘ
Sourcepub fn as_tuple_y_s(self) -> Option<(Y, MO, D, H, M, S)> ⓘ
pub fn as_tuple_y_s(self) -> Option<(Y, MO, D, H, M, S)> ⓘ
Sourcepub const fn to_tuple_y_s(&self) -> Option<(Y, MO, D, H, M, S)> ⓘ
pub const fn to_tuple_y_s(&self) -> Option<(Y, MO, D, H, M, S)> ⓘ
Sourcepub fn as_tuple_h_ns(self) -> Option<(H, M, S, MS, US, NS)> ⓘ
pub fn as_tuple_h_ns(self) -> Option<(H, M, S, MS, US, NS)> ⓘ
Sourcepub const fn to_tuple_h_ns(&self) -> Option<(H, M, S, MS, US, NS)> ⓘ
pub const fn to_tuple_h_ns(&self) -> Option<(H, M, S, MS, US, NS)> ⓘ
Sourcepub fn as_tuple_y_ns(self) -> Option<(Y, MO, D, H, M, S, MS, US, NS)> ⓘ
pub fn as_tuple_y_ns(self) -> Option<(Y, MO, D, H, M, S, MS, US, NS)> ⓘ
Trait Implementations
Source§impl<Y: Clone, MO: Clone, D: Clone, H: Clone, M: Clone, S: Clone, MS: Clone, US: Clone, NS: Clone> Clone for TimeSplit<Y, MO, D, H, M, S, MS, US, NS>
impl<Y: Clone, MO: Clone, D: Clone, H: Clone, M: Clone, S: Clone, MS: Clone, US: Clone, NS: Clone> Clone for TimeSplit<Y, MO, D, H, M, S, MS, US, NS>
Source§impl<Y: Default, MO: Default, D: Default, H: Default, M: Default, S: Default, MS: Default, US: Default, NS: Default> Default for TimeSplit<Y, MO, D, H, M, S, MS, US, NS>
impl<Y: Default, MO: Default, D: Default, H: Default, M: Default, S: Default, MS: Default, US: Default, NS: Default> Default for TimeSplit<Y, MO, D, H, M, S, MS, US, NS>
Source§impl<Y: Hash, MO: Hash, D: Hash, H: Hash, M: Hash, S: Hash, MS: Hash, US: Hash, NS: Hash> Hash for TimeSplit<Y, MO, D, H, M, S, MS, US, NS>
impl<Y: Hash, MO: Hash, D: Hash, H: Hash, M: Hash, S: Hash, MS: Hash, US: Hash, NS: Hash> Hash for TimeSplit<Y, MO, D, H, M, S, MS, US, NS>
Source§impl<Y: Ord, MO: Ord, D: Ord, H: Ord, M: Ord, S: Ord, MS: Ord, US: Ord, NS: Ord> Ord for TimeSplit<Y, MO, D, H, M, S, MS, US, NS>
impl<Y: Ord, MO: Ord, D: Ord, H: Ord, M: Ord, S: Ord, MS: Ord, US: Ord, NS: Ord> Ord for TimeSplit<Y, MO, D, H, M, S, MS, US, NS>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more