pub trait ReadStreamBackend: Send + Sync {
// Required methods
fn stream_exists<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn create_read_stream<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
max_event_bytes: u64,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn publish_to_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 StreamEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn populate_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
events: &'life1 [StreamEvent],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn subscribe_live<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
) -> Pin<Box<dyn Future<Output = Result<impl Stream<Item = Result<StreamEvent>> + Send>> + Send + 'async_trait>>
where N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Manages read-side RabbitMQ streams and live consumption.
Required Methods§
Sourcefn stream_exists<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stream_exists<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns true when the read stream already exists.
Sourcefn create_read_stream<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
max_event_bytes: u64,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_read_stream<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
max_event_bytes: u64,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a read stream sized for the namespace’s retention policy.
Sourcefn publish_to_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 StreamEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn publish_to_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 StreamEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Publish a versioned event to the read stream.
Sourcefn populate_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
events: &'life1 [StreamEvent],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn populate_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
events: &'life1 [StreamEvent],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Publish a batch of historical events during stream bootstrap.
Sourcefn subscribe_live<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
) -> Pin<Box<dyn Future<Output = Result<impl Stream<Item = Result<StreamEvent>> + Send>> + Send + 'async_trait>>where
N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn subscribe_live<'life0, 'life1, 'async_trait, N>(
&'life0 self,
namespace: &'life1 N,
) -> Pin<Box<dyn Future<Output = Result<impl Stream<Item = Result<StreamEvent>> + Send>> + Send + 'async_trait>>where
N: 'async_trait + Namespace,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Subscribe to the live tail of a read stream.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".