pub struct WindowConfig {
pub window_type: WindowType,
pub aggregation: WindowAggregation,
pub emit_partial: bool,
pub min_elements: usize,
}Expand description
Configuration for windowed aggregation.
Fields§
§window_type: WindowTypeWindow type (Tumbling, Sliding, Session, or Count).
aggregation: WindowAggregationAggregation function to apply within each window.
emit_partial: boolEmit a partial result for windows that do not span a complete interval.
min_elements: usizeMinimum number of elements required before a window result is emitted.
Implementations§
Source§impl WindowConfig
impl WindowConfig
Sourcepub fn tumbling(size_ms: u64, aggregation: WindowAggregation) -> Self
pub fn tumbling(size_ms: u64, aggregation: WindowAggregation) -> Self
Create a tumbling window configuration.
Sourcepub fn sliding(
size_ms: u64,
step_ms: u64,
aggregation: WindowAggregation,
) -> Self
pub fn sliding( size_ms: u64, step_ms: u64, aggregation: WindowAggregation, ) -> Self
Create a sliding window configuration.
Sourcepub fn count(size: usize, step: usize, aggregation: WindowAggregation) -> Self
pub fn count(size: usize, step: usize, aggregation: WindowAggregation) -> Self
Create a count-based window configuration.
Sourcepub fn with_emit_partial(self, emit: bool) -> Self
pub fn with_emit_partial(self, emit: bool) -> Self
Set whether partial (incomplete) windows should be emitted.
Sourcepub fn with_min_elements(self, min: usize) -> Self
pub fn with_min_elements(self, min: usize) -> Self
Set the minimum number of elements required to emit a window.
Trait Implementations§
Source§impl Clone for WindowConfig
impl Clone for WindowConfig
Source§fn clone(&self) -> WindowConfig
fn clone(&self) -> WindowConfig
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 moreAuto Trait Implementations§
impl Freeze for WindowConfig
impl RefUnwindSafe for WindowConfig
impl Send for WindowConfig
impl Sync for WindowConfig
impl Unpin for WindowConfig
impl UnsafeUnpin for WindowConfig
impl UnwindSafe for WindowConfig
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> 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