pub struct Window {
pub start: DateTime<Utc>,
pub end: DateTime<Utc>,
}Expand description
A window of time for grouping events.
Fields§
§start: DateTime<Utc>Window start time (inclusive)
end: DateTime<Utc>Window end time (exclusive)
Implementations§
Source§impl Window
impl Window
Sourcepub fn contains(&self, timestamp: &DateTime<Utc>) -> bool
pub fn contains(&self, timestamp: &DateTime<Utc>) -> bool
Check if a timestamp falls within this window.
Sourcepub fn merge(&self, other: &Window) -> Option<Window>
pub fn merge(&self, other: &Window) -> Option<Window>
Merge this window with another (if they overlap).
Sourcepub fn max_timestamp(&self) -> DateTime<Utc>
pub fn max_timestamp(&self) -> DateTime<Utc>
Get the maximum timestamp in this window.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Window
impl<'de> Deserialize<'de> for Window
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Window
impl StructuralPartialEq for Window
Auto Trait Implementations§
impl Freeze for Window
impl RefUnwindSafe for Window
impl Send for Window
impl Sync for Window
impl Unpin for Window
impl UnsafeUnpin for Window
impl UnwindSafe for Window
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