Trait intrepid_model::EventRepo
source · pub trait EventRepo {
// Required methods
fn entries_since_position<'life0, 'async_trait>(
&'life0 self,
stream_name: impl 'async_trait + AsRef<str> + Send,
position: i64,
) -> Pin<Box<dyn Future<Output = Result<EventLog, EventRepoError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn publish<'life0, 'async_trait, EventCandidate>(
&'life0 self,
event: EventCandidate,
) -> Pin<Box<dyn Future<Output = Result<(), EventRepoError>> + Send + 'async_trait>>
where EventCandidate: IntoEvent + Send + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait;
fn last<'life0, 'async_trait>(
&'life0 self,
stream_name: impl 'async_trait + AsRef<str> + Send,
kind: EventKind,
) -> Pin<Box<dyn Future<Output = Option<EventRecord>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn log_last_read<'life0, 'async_trait>(
&'life0 self,
stream_name: impl 'async_trait + AsRef<str> + Send,
subscriber_name: impl 'async_trait + AsRef<str> + Send,
position: i64,
) -> Pin<Box<dyn Future<Output = Result<(), EventRepoError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn last_read_position<'life0, 'async_trait>(
&'life0 self,
stream_name: impl 'async_trait + AsRef<str> + Send,
) -> Pin<Box<dyn Future<Output = i64> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn last_event_position<'life0, 'async_trait>(
&'life0 self,
stream_name: impl 'async_trait + AsRef<str> + Send,
) -> Pin<Box<dyn Future<Output = i64> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
}Expand description
The trait for an event repository. Implement this trait to provide an event repository interface for any given event storage implementation.
Required Methods§
sourcefn entries_since_position<'life0, 'async_trait>(
&'life0 self,
stream_name: impl 'async_trait + AsRef<str> + Send,
position: i64,
) -> Pin<Box<dyn Future<Output = Result<EventLog, EventRepoError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn entries_since_position<'life0, 'async_trait>(
&'life0 self,
stream_name: impl 'async_trait + AsRef<str> + Send,
position: i64,
) -> Pin<Box<dyn Future<Output = Result<EventLog, EventRepoError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get all entries in the stream since the given position.
Provided Methods§
sourcefn log_last_read<'life0, 'async_trait>(
&'life0 self,
stream_name: impl 'async_trait + AsRef<str> + Send,
subscriber_name: impl 'async_trait + AsRef<str> + Send,
position: i64,
) -> Pin<Box<dyn Future<Output = Result<(), EventRepoError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn log_last_read<'life0, 'async_trait>(
&'life0 self,
stream_name: impl 'async_trait + AsRef<str> + Send,
subscriber_name: impl 'async_trait + AsRef<str> + Send,
position: i64,
) -> Pin<Box<dyn Future<Output = Result<(), EventRepoError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Log the last read position for a subscriber. This leverages markers.
Object Safety§
This trait is not object safe.