pub struct TimeWindow {
pub start: DateTime<Utc>,
pub end: DateTime<Utc>,
pub id: String,
}Expand description
Represents a time window
Fields§
§start: DateTime<Utc>Window start time
end: DateTime<Utc>Window end time
id: StringWindow identifier
Implementations§
Source§impl TimeWindow
impl TimeWindow
Sourcepub fn new(start: DateTime<Utc>, end: DateTime<Utc>) -> Self
pub fn new(start: DateTime<Utc>, end: DateTime<Utc>) -> Self
Creates a new time window.
id is derived at nanosecond precision (falling back, saturating
rather than overflowing/panicking, to a second-precision value for
timestamps outside chrono’s nanosecond-representable range, such as
the sentinel DateTime::MIN_UTC/MAX_UTC used for
WindowType::Global). A second-precision id, as this used
unconditionally before, can collide for two genuinely distinct
windows that happen to start and end within the same wall-clock
second – which is routine for count-based windows (see
WindowedAggregator::process_count, whose windows’ start/end are
the real observed event times of their records, often only
microseconds apart under any real load) and for a burst of
high-frequency tumbling/sliding windows.
Trait Implementations§
Source§impl Clone for TimeWindow
impl Clone for TimeWindow
Source§fn clone(&self) -> TimeWindow
fn clone(&self) -> TimeWindow
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TimeWindow
impl Debug for TimeWindow
Source§impl<'de> Deserialize<'de> for TimeWindow
impl<'de> Deserialize<'de> for TimeWindow
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>,
Auto Trait Implementations§
impl Freeze for TimeWindow
impl RefUnwindSafe for TimeWindow
impl Send for TimeWindow
impl Sync for TimeWindow
impl Unpin for TimeWindow
impl UnsafeUnpin for TimeWindow
impl UnwindSafe for TimeWindow
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
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> ⓘ
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