pub struct TimeSplit<Y, MO, D, H, M, S, MS, US, NS> {
pub y: Y,
pub mo: MO,
pub d: D,
pub h: H,
pub m: M,
pub s: S,
pub ms: MS,
pub us: US,
pub ns: NS,
}
time
only.Expand description
A full time split from years to nanoseconds.
See also the related aliases:
Fields§
§y: Y
Years.
mo: MO
Months.
d: D
Days.
h: H
Hours.
m: M
Minutes.
s: S
Seconds.
ms: MS
Milliseconds.
us: US
Microseconds.
ns: NS
Nanoseconds.
Implementations§
Source§impl TimeSplit<u64, u8, u8, u8, u8, u8, u16, u16, u16>
impl TimeSplit<u64, u8, u8, u8, u8, u8, u16, u16, u16>
Sourcepub const fn from_duration(duration: Duration) -> Self
pub const fn from_duration(duration: Duration) -> Self
Converts a Duration
into a full TimeSplit
.
It assumes non-leap years and 30-day months for simplicity in calendar calculations.
Source§impl<Y, MO, D> TimeSplit<Y, MO, D, (), (), (), (), (), ()>
impl<Y, MO, D> TimeSplit<Y, MO, D, (), (), (), (), (), ()>
Sourcepub const fn new_year_day(y: Y, mo: MO, d: D) -> Self
pub const fn new_year_day(y: Y, mo: MO, d: D) -> Self
Returns a new TimeSplitYearDay
.
Source§impl TimeSplit<u64, u8, u8, (), (), (), (), (), ()>
impl TimeSplit<u64, u8, u8, (), (), (), (), (), ()>
Sourcepub const fn from_duration(duration: Duration) -> Self
pub const fn from_duration(duration: Duration) -> Self
Converts a Duration
into a TimeSplitYearDay
.
This method assumes 365 days per year and 30 days per month for simplicity.
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 TimeSplit<u64, u8, u8, u8, u8, u8, (), (), ()>
impl TimeSplit<u64, u8, u8, u8, u8, u8, (), (), ()>
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<H, M, S> TimeSplit<(), (), (), H, M, S, (), (), ()>
impl<H, M, S> TimeSplit<(), (), (), H, M, S, (), (), ()>
Sourcepub const fn new_hour_sec(h: H, m: M, s: S) -> Self
pub const fn new_hour_sec(h: H, m: M, s: S) -> Self
Returns a new TimeSplitHourSec
.
Source§impl TimeSplit<(), (), (), u64, u8, u8, (), (), ()>
impl TimeSplit<(), (), (), u64, u8, u8, (), (), ()>
Sourcepub const fn from_duration(duration: Duration) -> Self
pub const fn from_duration(duration: Duration) -> Self
Converts a Duration
into a TimeSplitHourSec
.
Excess days or longer periods are converted into additional hours.
Source§impl<MS, US, NS> TimeSplit<(), (), (), (), (), (), MS, US, NS>
impl<MS, US, NS> TimeSplit<(), (), (), (), (), (), MS, US, NS>
Sourcepub const fn new_milli_nano(ms: MS, us: US, ns: NS) -> Self
pub const fn new_milli_nano(ms: MS, us: US, ns: NS) -> Self
Returns a new TimeSplitMilliNano
.
Source§impl TimeSplit<(), (), (), (), (), (), u16, u16, u16>
impl TimeSplit<(), (), (), (), (), (), u16, u16, u16>
Sourcepub const fn from_duration(duration: Duration) -> Self
pub const fn from_duration(duration: Duration) -> Self
Converts a Duration
’s sub-second component into a compact time split representation.
Extracts and segments the nanosecond portion of a Duration
into milliseconds, microseconds, and nanoseconds.
Source§impl<H, M, S, MS, US, NS> TimeSplit<(), (), (), H, M, S, MS, US, NS>
impl<H, M, S, MS, US, NS> TimeSplit<(), (), (), H, M, S, MS, US, NS>
Sourcepub const fn new_hour_nano(h: H, m: M, s: S, ms: MS, us: US, ns: NS) -> Self
pub const fn new_hour_nano(h: H, m: M, s: S, ms: MS, us: US, ns: NS) -> Self
Returns a new TimeSplitHourNano
.
Source§impl TimeSplit<(), (), (), u64, u8, u8, u16, u16, u16>
impl TimeSplit<(), (), (), u64, u8, u8, u16, u16, u16>
Sourcepub const fn from_duration(duration: Duration) -> Self
pub const fn from_duration(duration: Duration) -> Self
Converts a Duration
into a time split representation from Hours down to nanoseconds.
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,
Source§impl<Y: PartialEq, MO: PartialEq, D: PartialEq, H: PartialEq, M: PartialEq, S: PartialEq, MS: PartialEq, US: PartialEq, NS: PartialEq> PartialEq for TimeSplit<Y, MO, D, H, M, S, MS, US, NS>
impl<Y: PartialEq, MO: PartialEq, D: PartialEq, H: PartialEq, M: PartialEq, S: PartialEq, MS: PartialEq, US: PartialEq, NS: PartialEq> PartialEq for TimeSplit<Y, MO, D, H, M, S, MS, US, NS>
Source§impl<Y: PartialOrd, MO: PartialOrd, D: PartialOrd, H: PartialOrd, M: PartialOrd, S: PartialOrd, MS: PartialOrd, US: PartialOrd, NS: PartialOrd> PartialOrd for TimeSplit<Y, MO, D, H, M, S, MS, US, NS>
impl<Y: PartialOrd, MO: PartialOrd, D: PartialOrd, H: PartialOrd, M: PartialOrd, S: PartialOrd, MS: PartialOrd, US: PartialOrd, NS: PartialOrd> PartialOrd for TimeSplit<Y, MO, D, H, M, S, MS, US, NS>
impl<Y: Copy, MO: Copy, D: Copy, H: Copy, M: Copy, S: Copy, MS: Copy, US: Copy, NS: Copy> Copy for TimeSplit<Y, MO, D, H, M, S, MS, US, NS>
impl<Y: Eq, MO: Eq, D: Eq, H: Eq, M: Eq, S: Eq, MS: Eq, US: Eq, NS: Eq> Eq for TimeSplit<Y, MO, D, H, M, S, MS, US, NS>
impl<Y, MO, D, H, M, S, MS, US, NS> StructuralPartialEq for TimeSplit<Y, MO, D, H, M, S, MS, US, NS>
Auto Trait Implementations§
impl<Y, MO, D, H, M, S, MS, US, NS> Freeze for TimeSplit<Y, MO, D, H, M, S, MS, US, NS>
impl<Y, MO, D, H, M, S, MS, US, NS> RefUnwindSafe for TimeSplit<Y, MO, D, H, M, S, MS, US, NS>where
Y: RefUnwindSafe,
MO: RefUnwindSafe,
D: RefUnwindSafe,
H: RefUnwindSafe,
M: RefUnwindSafe,
S: RefUnwindSafe,
MS: RefUnwindSafe,
US: RefUnwindSafe,
NS: RefUnwindSafe,
impl<Y, MO, D, H, M, S, MS, US, NS> Send for TimeSplit<Y, MO, D, H, M, S, MS, US, NS>
impl<Y, MO, D, H, M, S, MS, US, NS> Sync for TimeSplit<Y, MO, D, H, M, S, MS, US, NS>
impl<Y, MO, D, H, M, S, MS, US, NS> Unpin for TimeSplit<Y, MO, D, H, M, S, MS, US, NS>
impl<Y, MO, D, H, M, S, MS, US, NS> UnwindSafe for TimeSplit<Y, MO, D, H, M, S, MS, US, NS>where
Y: UnwindSafe,
MO: UnwindSafe,
D: UnwindSafe,
H: UnwindSafe,
M: UnwindSafe,
S: UnwindSafe,
MS: UnwindSafe,
US: UnwindSafe,
NS: UnwindSafe,
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ByteSized for T
impl<T> ByteSized for T
Source§const BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Source§fn byte_align(&self) -> usize ⓘ
fn byte_align(&self) -> usize ⓘ
Source§fn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Source§impl<T, R> Chain<R> for Twhere
T: ?Sized,
impl<T, R> Chain<R> for Twhere
T: ?Sized,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> ExtAny for T
impl<T> ExtAny for T
Source§fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Source§impl<T> ExtMem for Twhere
T: ?Sized,
impl<T> ExtMem for Twhere
T: ?Sized,
Source§const NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Source§fn mem_align_of_val(&self) -> usize ⓘ
fn mem_align_of_val(&self) -> usize ⓘ
Source§fn mem_size_of_val(&self) -> usize ⓘ
fn mem_size_of_val(&self) -> usize ⓘ
Source§fn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true
if dropping values of this type matters. Read moreSource§fn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self
without running its destructor. Read moreSource§fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Source§unsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSource§unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSource§fn mem_as_bytes(&self) -> &[u8] ⓘ
fn mem_as_bytes(&self) -> &[u8] ⓘ
unsafe_slice
only.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Hook for T
impl<T> Hook for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError> ⓘ
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError> ⓘ
§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out
indicating that a T
is niched.