pub struct SessionWindow { /* private fields */ }Expand description
Session window (dynamic windows based on activity).
Implementations§
Source§impl SessionWindow
impl SessionWindow
Sourcepub fn with_max_duration(gap: Duration, max_duration: Duration) -> Self
pub fn with_max_duration(gap: Duration, max_duration: Duration) -> Self
Create a new session window with maximum duration.
Sourcepub fn assign(&mut self, timestamp: DateTime<Utc>) -> Result<Window>
pub fn assign(&mut self, timestamp: DateTime<Utc>) -> Result<Window>
Assign an element to a session window.
Sourcepub fn active_sessions(&self) -> Vec<Window>
pub fn active_sessions(&self) -> Vec<Window>
Get all active sessions.
Sourcepub fn clear_expired(&mut self, watermark: DateTime<Utc>)
pub fn clear_expired(&mut self, watermark: DateTime<Utc>)
Clear expired sessions.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SessionWindow
impl RefUnwindSafe for SessionWindow
impl Send for SessionWindow
impl Sync for SessionWindow
impl Unpin for SessionWindow
impl UnsafeUnpin for SessionWindow
impl UnwindSafe for SessionWindow
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