pub struct EventStream {
pub events: Vec<DashboardEvent>,
pub max_buffer_size: usize,
pub is_active: bool,
}Expand description
Event stream for real-time dashboard updates
Fields§
§events: Vec<DashboardEvent>Buffer of recent events
max_buffer_size: usizeMaximum number of events to buffer
is_active: boolWhether the stream is actively monitoring
Implementations§
Source§impl EventStream
impl EventStream
Sourcepub fn with_buffer_size(buffer_size: usize) -> Self
pub fn with_buffer_size(buffer_size: usize) -> Self
Create a new event stream with custom buffer size
Sourcepub fn add_event(&mut self, event: DashboardEvent)
pub fn add_event(&mut self, event: DashboardEvent)
Add an event to the stream
Sourcepub fn recent_events(&self, window_secs: i64) -> Vec<&DashboardEvent>
pub fn recent_events(&self, window_secs: i64) -> Vec<&DashboardEvent>
Get recent events within a time window (in seconds)
Sourcepub fn events_of_type(
&self,
event_type: &DashboardEventType,
) -> Vec<&DashboardEvent>
pub fn events_of_type( &self, event_type: &DashboardEventType, ) -> Vec<&DashboardEvent>
Get events of a specific type
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 · 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
Auto Trait Implementations§
impl Freeze for EventStream
impl RefUnwindSafe for EventStream
impl Send for EventStream
impl Sync for EventStream
impl Unpin for EventStream
impl UnwindSafe for EventStream
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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