pub enum BucketWidth {
Fixed(i64),
Days(u32),
Months(u32),
}Expand description
How wide a bucket is, and therefore whether it varies.
Variants§
Fixed(i64)
A fixed span of nanoseconds. Never varies.
Days(u32)
A whole number of calendar days. Varies across a daylight-saving transition when the bucket is zoned.
Months(u32)
A whole number of calendar months. 3 is a quarter, 12 a year.
Implementations§
Source§impl BucketWidth
impl BucketWidth
Sourcepub fn nominal_ns(self) -> i64
pub fn nominal_ns(self) -> i64
Roughly how long this bucket is, for a caller that needs one number.
An estimate for calendar widths, and only ever used where an
estimate is correct — sizing a scan, ordering two tiers by coarseness.
A month is 30.44 days here and never that in reality, so anything that
must be right uses TimeBucket::next.
Sourcepub fn is_calendar(self) -> bool
pub fn is_calendar(self) -> bool
Whether this width follows a calendar rather than a fixed span.
Trait Implementations§
Source§impl Clone for BucketWidth
impl Clone for BucketWidth
Source§fn clone(&self) -> BucketWidth
fn clone(&self) -> BucketWidth
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for BucketWidth
Source§impl Debug for BucketWidth
impl Debug for BucketWidth
Source§impl<'de> Deserialize<'de> for BucketWidth
impl<'de> Deserialize<'de> for BucketWidth
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for BucketWidth
impl Display for BucketWidth
impl Eq for BucketWidth
Source§impl FromStr for BucketWidth
impl FromStr for BucketWidth
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Parse 15m, 1h, 1d, 1w, 1mo, 1y.
mo is the month, never M: a case-sensitive distinction between
minute and month is the kind that is wrong once and then wrong for
three years of stored data. InfluxDB spells it mo for the same
reason.