Struct intrepid_model::IntrepidConnection
source · pub struct IntrepidConnection<Repo> {
pub repo: Repo,
}Expand description
A connection to an intrepid repository that combines the functionality of a cache and an event connection.
Fields§
§repo: RepoThe underlying repository.
Implementations§
source§impl<Repo> IntrepidConnection<Repo>
impl<Repo> IntrepidConnection<Repo>
sourcepub fn event_connection(
&self,
target_stream_name: impl AsRef<str> + Send,
own_stream_name: impl AsRef<str> + Send,
) -> EventConnection<Repo>
pub fn event_connection( &self, target_stream_name: impl AsRef<str> + Send, own_stream_name: impl AsRef<str> + Send, ) -> EventConnection<Repo>
Accept a stream name and marker stream name, and return an event connection
sourcepub fn cache_connection(&self) -> CacheConnection<Repo>
pub fn cache_connection(&self) -> CacheConnection<Repo>
Get a cache connection
sourcepub fn into_inner(self) -> Repo
pub fn into_inner(self) -> Repo
Consume the connection and return the inner repository
Trait Implementations§
source§impl<Repo> CacheRepo for IntrepidConnection<Repo>
impl<Repo> CacheRepo for IntrepidConnection<Repo>
source§fn get_memo<'life0, 'async_trait>(
&'life0 self,
uri: impl 'async_trait + AsRef<str> + Send,
) -> Pin<Box<dyn Future<Output = Result<Cache<CacheRecord>, CacheRepoError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_memo<'life0, 'async_trait>(
&'life0 self,
uri: impl 'async_trait + AsRef<str> + Send,
) -> Pin<Box<dyn Future<Output = Result<Cache<CacheRecord>, CacheRepoError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get a memo by URI
source§impl<Repo: Clone> Clone for IntrepidConnection<Repo>
impl<Repo: Clone> Clone for IntrepidConnection<Repo>
source§fn clone(&self) -> IntrepidConnection<Repo>
fn clone(&self) -> IntrepidConnection<Repo>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<Repo: Debug> Debug for IntrepidConnection<Repo>
impl<Repo: Debug> Debug for IntrepidConnection<Repo>
source§impl<Repo> EventRepo for IntrepidConnection<Repo>
impl<Repo> EventRepo for IntrepidConnection<Repo>
source§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 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.
source§fn publish<'life0, 'async_trait, EventCandidate>(
&'life0 self,
event: EventCandidate,
) -> Pin<Box<dyn Future<Output = Result<(), EventRepoError>> + Send + 'async_trait>>
fn publish<'life0, 'async_trait, EventCandidate>( &'life0 self, event: EventCandidate, ) -> Pin<Box<dyn Future<Output = Result<(), EventRepoError>> + Send + 'async_trait>>
Publish an event to the target stream.
source§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,
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,
Get the last event in the stream.
source§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 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.
Auto Trait Implementations§
impl<Repo> Freeze for IntrepidConnection<Repo>where
Repo: Freeze,
impl<Repo> RefUnwindSafe for IntrepidConnection<Repo>where
Repo: RefUnwindSafe,
impl<Repo> Send for IntrepidConnection<Repo>where
Repo: Send,
impl<Repo> Sync for IntrepidConnection<Repo>where
Repo: Sync,
impl<Repo> Unpin for IntrepidConnection<Repo>where
Repo: Unpin,
impl<Repo> UnwindSafe for IntrepidConnection<Repo>where
Repo: UnwindSafe,
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)