pub struct SessionWindow { /* private fields */ }Expand description
A session window with dynamic boundaries based on activity gaps.
Implementations§
Source§impl SessionWindow
impl SessionWindow
Sourcepub fn new(start: DateTime<Utc>, end: DateTime<Utc>, gap: Duration) -> Self
pub fn new(start: DateTime<Utc>, end: DateTime<Utc>, gap: Duration) -> Self
Creates a new session window.
Sourcepub fn from_element(timestamp: DateTime<Utc>, gap: Duration) -> Self
pub fn from_element(timestamp: DateTime<Utc>, gap: Duration) -> Self
Creates a session window from a single element timestamp.
Sourcepub fn contains(&self, timestamp: DateTime<Utc>) -> bool
pub fn contains(&self, timestamp: DateTime<Utc>) -> bool
Returns true if this session contains the timestamp.
Sourcepub fn should_merge(&self, other: &SessionWindow) -> bool
pub fn should_merge(&self, other: &SessionWindow) -> bool
Returns true if this session should merge with another.
Sourcepub fn merge(&self, other: &SessionWindow) -> Option<SessionWindow>
pub fn merge(&self, other: &SessionWindow) -> Option<SessionWindow>
Merges this session with another.
Trait Implementations§
Source§impl Clone for SessionWindow
impl Clone for SessionWindow
Source§fn clone(&self) -> SessionWindow
fn clone(&self) -> SessionWindow
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 SessionWindow
impl Debug for SessionWindow
Source§impl Display for SessionWindow
impl Display for SessionWindow
Source§impl Hash for SessionWindow
impl Hash for SessionWindow
Source§impl PartialEq for SessionWindow
impl PartialEq for SessionWindow
Source§impl WindowTrigger<SessionWindow> for SessionTrigger
impl WindowTrigger<SessionWindow> for SessionTrigger
Source§fn on_element(
&mut self,
timestamp: DateTime<Utc>,
window: &SessionWindow,
) -> TriggerResult
fn on_element( &mut self, timestamp: DateTime<Utc>, window: &SessionWindow, ) -> TriggerResult
Called when an element is added to a window.
Source§fn on_processing_time(
&mut self,
_time: DateTime<Utc>,
_window: &SessionWindow,
) -> TriggerResult
fn on_processing_time( &mut self, _time: DateTime<Utc>, _window: &SessionWindow, ) -> TriggerResult
Called when processing time advances.
Source§fn on_event_time(
&mut self,
watermark: DateTime<Utc>,
window: &SessionWindow,
) -> TriggerResult
fn on_event_time( &mut self, watermark: DateTime<Utc>, window: &SessionWindow, ) -> TriggerResult
Called when the watermark (event time) advances.
Source§fn clear(&mut self, window: &SessionWindow)
fn clear(&mut self, window: &SessionWindow)
Called when the trigger is cleared.
Source§fn clone_trigger(&self) -> Box<dyn WindowTrigger<SessionWindow>>
fn clone_trigger(&self) -> Box<dyn WindowTrigger<SessionWindow>>
Creates a clone of this trigger.
impl Eq for SessionWindow
Auto Trait Implementations§
impl Freeze for SessionWindow
impl RefUnwindSafe for SessionWindow
impl Send for SessionWindow
impl Sync for SessionWindow
impl Unpin 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