#[non_exhaustive]pub enum TimeGranularity {
None,
Hours,
Minutes,
Seconds,
Nanoseconds,
}
Expand description
The granularity of time represented in a Pattern
.
Ordered from least granular to most granular for comparison.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
None
No time is in the pattern.
Hours
Smallest time unit = hours.
Minutes
Smallest time unit = minutes.
Seconds
Smallest time unit = seconds.
Nanoseconds
Smallest time unit = nanoseconds.
Implementations§
source§impl TimeGranularity
impl TimeGranularity
Trait Implementations§
source§impl Bake for TimeGranularity
impl Bake for TimeGranularity
source§fn bake(&self, env: &CrateEnv) -> TokenStream
fn bake(&self, env: &CrateEnv) -> TokenStream
source§impl BakeSize for TimeGranularity
impl BakeSize for TimeGranularity
source§fn borrows_size(&self) -> usize
fn borrows_size(&self) -> usize
Returns the size
source§impl Clone for TimeGranularity
impl Clone for TimeGranularity
source§fn clone(&self) -> TimeGranularity
fn clone(&self) -> TimeGranularity
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TimeGranularity
impl Debug for TimeGranularity
source§impl Default for TimeGranularity
impl Default for TimeGranularity
source§fn default() -> TimeGranularity
fn default() -> TimeGranularity
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for TimeGranularity
impl<'de> Deserialize<'de> for TimeGranularity
source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TimeGranularity, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TimeGranularity, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<PatternItem> for TimeGranularity
impl From<PatternItem> for TimeGranularity
source§fn from(item: PatternItem) -> TimeGranularity
fn from(item: PatternItem) -> TimeGranularity
Retrieves the granularity of time represented by a PatternItem
.
If the PatternItem
is not time-related, returns None
.
source§impl Ord for TimeGranularity
impl Ord for TimeGranularity
source§fn cmp(&self, other: &TimeGranularity) -> Ordering
fn cmp(&self, other: &TimeGranularity) -> Ordering
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
source§impl PartialEq for TimeGranularity
impl PartialEq for TimeGranularity
source§impl PartialOrd for TimeGranularity
impl PartialOrd for TimeGranularity
source§impl Serialize for TimeGranularity
impl Serialize for TimeGranularity
source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
source§impl<'a> Yokeable<'a> for TimeGranularitywhere
TimeGranularity: Sized,
impl<'a> Yokeable<'a> for TimeGranularitywhere
TimeGranularity: Sized,
source§type Output = TimeGranularity
type Output = TimeGranularity
This type MUST be
Self
with the 'static
replaced with 'a
, i.e. Self<'a>
source§fn transform_owned(self) -> <TimeGranularity as Yokeable<'a>>::Output
fn transform_owned(self) -> <TimeGranularity as Yokeable<'a>>::Output
source§unsafe fn make(
this: <TimeGranularity as Yokeable<'a>>::Output,
) -> TimeGranularity
unsafe fn make( this: <TimeGranularity as Yokeable<'a>>::Output, ) -> TimeGranularity
This method can be used to cast away
Self<'a>
’s lifetime. Read moresource§fn transform_mut<F>(&'a mut self, f: F)
fn transform_mut<F>(&'a mut self, f: F)
This method must cast
self
between &'a mut Self<'static>
and &'a mut Self<'a>
,
and pass it to f
. Read moresource§impl<'zf> ZeroFrom<'zf, TimeGranularity> for TimeGranularity
impl<'zf> ZeroFrom<'zf, TimeGranularity> for TimeGranularity
source§fn zero_from(this: &'zf TimeGranularity) -> TimeGranularity
fn zero_from(this: &'zf TimeGranularity) -> TimeGranularity
Clone the other
C
into a struct that may retain references into C
.impl Copy for TimeGranularity
impl Eq for TimeGranularity
impl StructuralPartialEq for TimeGranularity
Auto Trait Implementations§
impl Freeze for TimeGranularity
impl RefUnwindSafe for TimeGranularity
impl Send for TimeGranularity
impl Sync for TimeGranularity
impl Unpin for TimeGranularity
impl UnwindSafe for TimeGranularity
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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>
Converts
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>
Converts
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