pub struct WindowManager { /* private fields */ }Expand description
Generic window manager for streaming aggregations
Implementations§
Source§impl WindowManager
impl WindowManager
Sourcepub fn new(window_type: WindowType) -> Self
pub fn new(window_type: WindowType) -> Self
Create a new window manager
Sourcepub fn aggregate(
&mut self,
field: &str,
function: AggregateFunction,
output_name: &str,
) -> &mut Self
pub fn aggregate( &mut self, field: &str, function: AggregateFunction, output_name: &str, ) -> &mut Self
Add an aggregation specification
Sourcepub fn process(
&mut self,
timestamp: DateTime<Utc>,
fields: HashMap<String, ValueWord>,
) -> Result<()>
pub fn process( &mut self, timestamp: DateTime<Utc>, fields: HashMap<String, ValueWord>, ) -> Result<()>
Process a data point
Sourcepub fn take_completed(&mut self) -> Vec<WindowResult>
pub fn take_completed(&mut self) -> Vec<WindowResult>
Take completed windows
Sourcepub fn flush(&mut self) -> Result<Vec<WindowResult>>
pub fn flush(&mut self) -> Result<Vec<WindowResult>>
Flush any remaining windows (call at end of stream)
Auto Trait Implementations§
impl Freeze for WindowManager
impl RefUnwindSafe for WindowManager
impl Send for WindowManager
impl Sync for WindowManager
impl Unpin for WindowManager
impl UnsafeUnpin for WindowManager
impl UnwindSafe for WindowManager
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> 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