pub struct InMemoryEventEmitter { /* private fields */ }Expand description
In-memory event emitter for testing
Stores emitted events in memory for inspection. Useful for testing and examples where you want to verify events without a database.
§Example
ⓘ
use everruns_core::memory::InMemoryEventEmitter;
let emitter = InMemoryEventEmitter::new();
// Emit events...
// Check emitted events
let events = emitter.events().await;
assert_eq!(events.len(), 2);Implementations§
Source§impl InMemoryEventEmitter
impl InMemoryEventEmitter
Sourcepub async fn event_count(&self) -> usize
pub async fn event_count(&self) -> usize
Get the count of emitted events
Sourcepub async fn events_by_type(&self, event_type: &str) -> Vec<Event>
pub async fn events_by_type(&self, event_type: &str) -> Vec<Event>
Get events by type
Sourcepub async fn events_for_session(&self, session_id: Uuid) -> Vec<Event>
pub async fn events_for_session(&self, session_id: Uuid) -> Vec<Event>
Get events for a specific session
Trait Implementations§
Source§impl Clone for InMemoryEventEmitter
impl Clone for InMemoryEventEmitter
Source§fn clone(&self) -> InMemoryEventEmitter
fn clone(&self) -> InMemoryEventEmitter
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 InMemoryEventEmitter
impl Debug for InMemoryEventEmitter
Source§impl Default for InMemoryEventEmitter
impl Default for InMemoryEventEmitter
Source§fn default() -> InMemoryEventEmitter
fn default() -> InMemoryEventEmitter
Returns the “default value” for a type. Read more
Source§impl EventEmitter for InMemoryEventEmitter
impl EventEmitter for InMemoryEventEmitter
Auto Trait Implementations§
impl Freeze for InMemoryEventEmitter
impl !RefUnwindSafe for InMemoryEventEmitter
impl Send for InMemoryEventEmitter
impl Sync for InMemoryEventEmitter
impl Unpin for InMemoryEventEmitter
impl UnsafeUnpin for InMemoryEventEmitter
impl !UnwindSafe for InMemoryEventEmitter
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request