pub struct Span {
pub window: Window,
pub start: Option<Timestamp>,
pub end: Timestamp,
pub reckoned_in: Option<TimeZone>,
pub horizon: Timestamp,
}Expand description
A resolved Window: two instants, and an honest account of how they were arrived at.
Fields§
§window: WindowThe window this came from.
start: Option<Timestamp>When the period starts. None means “from the beginning of what is kept”.
end: TimestampWhen the period ends, which is the moment it was resolved.
reckoned_in: Option<TimeZone>The zone the start was reckoned in, or None for a rolling window.
horizon: TimestampThe oldest instant retention still keeps.
Implementations§
Source§impl Span
impl Span
Sourcepub fn contains(&self, at: Timestamp) -> bool
pub fn contains(&self, at: Timestamp) -> bool
Returns true when at falls inside the period.
Half-open: the start is included and the end is not, so consecutive windows tile without counting a run at the boundary twice.
Sourcepub fn truncated_by_retention(&self) -> bool
pub fn truncated_by_retention(&self) -> bool
Returns true when the period reaches further back than retention keeps.
A total over such a window is a lower bound, not a total, and saying so is the same
principle that makes crate::cost::CostSource a field: a number whose provenance is
unstated will eventually be trusted more than it deserves.
Sourcepub fn zone_name(&self) -> Option<&str>
pub fn zone_name(&self) -> Option<&str>
The name of the zone the start was reckoned in, when one was needed.
Sourcepub fn duration_secs(&self) -> Option<i64>
pub fn duration_secs(&self) -> Option<i64>
How long the period is, in whole seconds, or None for an open start.