pub struct TimeRange {
pub min_time: i64,
pub max_time: i64,
}Expand description
Half-open time range [min_time, max_time).
max_time is exclusive, matching Prometheus block bounds. A range with
max_time <= min_time selects nothing.
Fields§
§min_time: i64Inclusive lower bound.
max_time: i64Exclusive upper bound.
Implementations§
Source§impl TimeRange
impl TimeRange
Sourcepub const fn new(min_time: i64, max_time: i64) -> Self
pub const fn new(min_time: i64, max_time: i64) -> Self
Builds a range. An empty range (max_time <= min_time) yields nothing.
Sourcepub const fn overlaps_chunk(&self, chunk_min: i64, chunk_max: i64) -> bool
pub const fn overlaps_chunk(&self, chunk_min: i64, chunk_max: i64) -> bool
True when the closed interval [min_time, max_time] of a chunk
intersects the range.
Sourcepub const fn duration_ms(&self) -> i64
pub const fn duration_ms(&self) -> i64
Number of milliseconds covered, saturating at zero for empty ranges.
Trait Implementations§
impl Copy for TimeRange
impl Eq for TimeRange
impl StructuralPartialEq for TimeRange
Auto Trait Implementations§
impl Forget for TimeRange
impl Freeze for TimeRange
impl Move for TimeRange
impl RefUnwindSafe for TimeRange
impl Send for TimeRange
impl Sync for TimeRange
impl Unpin for TimeRange
impl UnsafeUnpin for TimeRange
impl UnwindSafe for TimeRange
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