common_time::timestamp_millis

Trait BucketAligned

source
pub trait BucketAligned: Sized {
    // Required methods
    fn align_by_bucket(self, bucket_duration: i64) -> Option<Self>;
    fn align_to_ceil_by_bucket(self, bucket_duration: i64) -> Option<Self>;
}

Required Methods§

source

fn align_by_bucket(self, bucket_duration: i64) -> Option<Self>

Aligns the value by bucket_duration or None if underflow occurred.

§Panics

Panics if bucket_duration <= 0.

source

fn align_to_ceil_by_bucket(self, bucket_duration: i64) -> Option<Self>

Aligns the value by bucket_duration to ceil or None if overflow occurred.

§Panics

Panics if bucket_duration <= 0.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

source§

impl BucketAligned for i64

source§

fn align_by_bucket(self, bucket_duration: i64) -> Option<Self>

source§

fn align_to_ceil_by_bucket(self, bucket_duration: i64) -> Option<Self>

Implementors§