pub enum WindowKind {
Tumbling {
size: WindowSize,
},
Sliding {
size: WindowSize,
slide: WindowSize,
},
Rolling {
size: WindowSize,
},
Session {
gap: Duration,
},
}Expand description
A fully specified window kind. Each variant carries only the parameters that make sense for that kind.
Variants§
Tumbling
Fixed-size, non-overlapping windows. Each event belongs to exactly one window.
Fields
§
size: WindowSizeSliding
Fixed-size, overlapping windows. Each event can belong to multiple windows. Invariant: slide < size, and both must be the same measure type.
Rolling
Continuously maintained window of the most recent N events or most recent T duration. One window per group. Triggers every event.
Fields
§
size: WindowSizeSession
Gap-based window. Stays open while events arrive within gap.
Closes after gap duration of inactivity per group key.
Implementations§
Source§impl WindowKind
impl WindowKind
Sourcepub fn size(&self) -> Option<&WindowSize>
pub fn size(&self) -> Option<&WindowSize>
Returns the primary size measure for Tumbling, Sliding, and Rolling. Returns None for Session (which uses gap instead).
Trait Implementations§
Source§impl Clone for WindowKind
impl Clone for WindowKind
Source§fn clone(&self) -> WindowKind
fn clone(&self) -> WindowKind
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WindowKind
impl Debug for WindowKind
Source§impl<'de> Deserialize<'de> for WindowKind
impl<'de> Deserialize<'de> for WindowKind
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
Source§impl PartialEq for WindowKind
impl PartialEq for WindowKind
Source§impl Serialize for WindowKind
impl Serialize for WindowKind
impl StructuralPartialEq for WindowKind
Auto Trait Implementations§
impl Freeze for WindowKind
impl RefUnwindSafe for WindowKind
impl Send for WindowKind
impl Sync for WindowKind
impl Unpin for WindowKind
impl UnsafeUnpin for WindowKind
impl UnwindSafe for WindowKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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