pub struct TimeWindow<T> {
pub start_time: SystemTime,
pub end_time: SystemTime,
pub events: Vec<T>,
}Expand description
A time-based window of events
Fields§
§start_time: SystemTime§end_time: SystemTime§events: Vec<T>Implementations§
Source§impl<T> TimeWindow<T>
impl<T> TimeWindow<T>
pub fn new(start_time: SystemTime, end_time: SystemTime) -> Self
pub fn add_event(&mut self, event: T)
pub fn is_complete(&self, watermark: SystemTime) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for TimeWindow<T>
impl<T> RefUnwindSafe for TimeWindow<T>where
T: RefUnwindSafe,
impl<T> Send for TimeWindow<T>where
T: Send,
impl<T> Sync for TimeWindow<T>where
T: Sync,
impl<T> Unpin for TimeWindow<T>where
T: Unpin,
impl<T> UnwindSafe for TimeWindow<T>where
T: UnwindSafe,
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