pub struct EventLog { /* private fields */ }Expand description
Event log - wraps an event store with subscription support
Implementations§
Source§impl EventLog
impl EventLog
Sourcepub fn new(store: Arc<dyn EventStore>) -> Self
pub fn new(store: Arc<dyn EventStore>) -> Self
Create a new event log with the given store
Sourcepub async fn append(&self, event: ExecutionEvent) -> Result<EventLogEntry>
pub async fn append(&self, event: ExecutionEvent) -> Result<EventLogEntry>
Append an event
Sourcepub async fn get_by_execution(
&self,
execution_id: &ExecutionId,
) -> Result<Vec<EventLogEntry>>
pub async fn get_by_execution( &self, execution_id: &ExecutionId, ) -> Result<Vec<EventLogEntry>>
Get events for an execution
Sourcepub async fn get_after(
&self,
after_sequence: u64,
limit: usize,
) -> Result<Vec<EventLogEntry>>
pub async fn get_after( &self, after_sequence: u64, limit: usize, ) -> Result<Vec<EventLogEntry>>
Get events after a sequence number (for polling/streaming)
Sourcepub async fn latest_sequence(&self) -> Result<u64>
pub async fn latest_sequence(&self) -> Result<u64>
Get the latest sequence number
Sourcepub fn store(&self) -> &Arc<dyn EventStore>
pub fn store(&self) -> &Arc<dyn EventStore>
Get access to the underlying store
Auto Trait Implementations§
impl Freeze for EventLog
impl !RefUnwindSafe for EventLog
impl Send for EventLog
impl Sync for EventLog
impl Unpin for EventLog
impl UnsafeUnpin for EventLog
impl !UnwindSafe for EventLog
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