pub trait EventStore: Send + Sync {
// Required methods
fn ensure_namespace<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn persist_next<'life0, 'life1, 'life2, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
payload: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<StreamEvent>> + Send + 'async_trait>>
where N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn load_history<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
limit: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<StreamEvent>>> + Send + 'async_trait>>
where N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn load_after_version<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
after_version: EventVersion,
limit: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<StreamEvent>>> + Send + 'async_trait>>
where N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn latest_version<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
) -> Pin<Box<dyn Future<Output = Result<Option<EventVersion>>> + Send + 'async_trait>>
where N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Persistent event storage keyed by namespace.
Required Methods§
Sourcefn ensure_namespace<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn ensure_namespace<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Ensure storage exists for the namespace.
Sourcefn persist_next<'life0, 'life1, 'life2, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
payload: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<StreamEvent>> + Send + 'async_trait>>where
N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn persist_next<'life0, 'life1, 'life2, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
payload: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<StreamEvent>> + Send + 'async_trait>>where
N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Allocate the next monotonic version and persist the event atomically.
Sourcefn load_history<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
limit: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<StreamEvent>>> + Send + 'async_trait>>where
N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_history<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
limit: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<StreamEvent>>> + Send + 'async_trait>>where
N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load up to limit most recent events in ascending version order.
Sourcefn load_after_version<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
after_version: EventVersion,
limit: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<StreamEvent>>> + Send + 'async_trait>>where
N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_after_version<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
after_version: EventVersion,
limit: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<StreamEvent>>> + Send + 'async_trait>>where
N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load events with version strictly greater than after_version.
Sourcefn latest_version<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
) -> Pin<Box<dyn Future<Output = Result<Option<EventVersion>>> + Send + 'async_trait>>where
N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn latest_version<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
) -> Pin<Box<dyn Future<Output = Result<Option<EventVersion>>> + Send + 'async_trait>>where
N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Latest assigned version for the namespace, if any events exist.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".