pub enum TimeBucket {
Seconds(u32),
Minutes(u32),
Hours(u32),
Days(u32),
}Expand description
Granularity for time buckets used by coverage/bitmap logic.
This does not affect physical storage directly, but describes how the time axis is discretized when building coverage bitmaps and computing gaps.
Variants§
Seconds(u32)
A bucket spanning a fixed number of seconds.
Minutes(u32)
A bucket spanning a fixed number of minutes.
Hours(u32)
A bucket spanning a fixed number of hours.
Days(u32)
A bucket spanning a fixed number of days.
Implementations§
Source§impl TimeBucket
impl TimeBucket
Sourcepub fn parse(spec: &str) -> Result<TimeBucket, ParseTimeBucketError>
pub fn parse(spec: &str) -> Result<TimeBucket, ParseTimeBucketError>
Parse a human-friendly time bucket spec (e.g. 1h, 15m, 30s, 2d).
This is a convenience wrapper around str::parse for TimeBucket, and
accepts common unit aliases (e.g. sec, min, hr, day).
§Errors
Returns ParseTimeBucketError if the spec is empty, missing a unit,
has an invalid or non-positive number, overflows u32, or uses an
unsupported unit.
Trait Implementations§
Source§impl Clone for TimeBucket
impl Clone for TimeBucket
Source§fn clone(&self) -> TimeBucket
fn clone(&self) -> TimeBucket
Returns a duplicate 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 TimeBucket
impl Debug for TimeBucket
Source§impl<'de> Deserialize<'de> for TimeBucket
impl<'de> Deserialize<'de> for TimeBucket
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TimeBucket, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TimeBucket, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl FromStr for TimeBucket
impl FromStr for TimeBucket
Source§type Err = ParseTimeBucketError
type Err = ParseTimeBucketError
The associated error which can be returned from parsing.
Source§fn from_str(input: &str) -> Result<TimeBucket, <TimeBucket as FromStr>::Err>
fn from_str(input: &str) -> Result<TimeBucket, <TimeBucket as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl PartialEq for TimeBucket
impl PartialEq for TimeBucket
Source§impl Serialize for TimeBucket
impl Serialize for TimeBucket
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
impl Eq for TimeBucket
impl StructuralPartialEq for TimeBucket
Auto Trait Implementations§
impl Freeze for TimeBucket
impl RefUnwindSafe for TimeBucket
impl Send for TimeBucket
impl Sync for TimeBucket
impl Unpin for TimeBucket
impl UnsafeUnpin for TimeBucket
impl UnwindSafe for TimeBucket
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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