pub struct Window<T> { /* private fields */ }Available on crate feature
std only.Expand description
A closed window of items with a start and end instant.
start <= end always holds. For tumbling and sliding windows
end - start == size (modulo end-of-stream flushes). For session
windows end is the instant of the last item that arrived inside
the session.
Implementations§
Source§impl<T> Window<T>
impl<T> Window<T>
Sourcepub fn new(items: Vec<T>, start: Instant, end: Instant) -> Self
pub fn new(items: Vec<T>, start: Instant, end: Instant) -> Self
Construct a window directly from parts. Primarily for tests and custom Stage implementations.
Sourcepub fn end(&self) -> Instant
pub fn end(&self) -> Instant
Window end instant. For tumbling/sliding, this is start + size.
For session, this is the timestamp of the last item.
Sourcepub fn into_inner(self) -> Vec<T>
pub fn into_inner(self) -> Vec<T>
Unwrap the inner item vec.
Trait Implementations§
Source§impl<'a, T> IntoIterator for &'a Window<T>
impl<'a, T> IntoIterator for &'a Window<T>
Auto Trait Implementations§
impl<T> Freeze for Window<T>
impl<T> RefUnwindSafe for Window<T>where
T: RefUnwindSafe,
impl<T> Send for Window<T>where
T: Send,
impl<T> Sync for Window<T>where
T: Sync,
impl<T> Unpin for Window<T>where
T: Unpin,
impl<T> UnsafeUnpin for Window<T>
impl<T> UnwindSafe for Window<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