pub struct EventStream { /* private fields */ }Expand description
Cloneable, in-memory journal keyed by scan ID.
Implementations§
Source§impl EventStream
impl EventStream
pub fn new() -> Self
Sourcepub fn record(
&self,
event: RealtimeEvent,
) -> Result<(), RealtimeEventValidationError>
pub fn record( &self, event: RealtimeEvent, ) -> Result<(), RealtimeEventValidationError>
Records a valid event in memory. It does not deliver the event to a client.
Invalid float ranges and empty scan IDs are rejected without mutating the journal.
pub fn events(&self, scan_id: &str) -> Vec<RealtimeEvent>
pub fn events_since( &self, scan_id: &str, since_exclusive: u64, ) -> Vec<RealtimeEvent>
pub fn recent_events(&self, scan_id: &str, limit: usize) -> Vec<RealtimeEvent>
Sourcepub fn clear_events(&self, scan_id: &str) -> usize
pub fn clear_events(&self, scan_id: &str) -> usize
Removes an in-memory journal and returns the number of removed events.
pub fn event_count(&self, scan_id: &str) -> usize
Trait Implementations§
Source§impl Clone for EventStream
impl Clone for EventStream
Source§fn clone(&self) -> EventStream
fn clone(&self) -> EventStream
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 EventStream
impl Debug for EventStream
Source§impl Default for EventStream
impl Default for EventStream
Source§fn default() -> EventStream
fn default() -> EventStream
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for EventStream
impl !UnwindSafe for EventStream
impl Freeze for EventStream
impl Send for EventStream
impl Sync for EventStream
impl Unpin for EventStream
impl UnsafeUnpin for EventStream
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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