intrepid_model

Struct 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: Repo

The underlying repository.

Implementations§

Source§

impl<Repo> IntrepidConnection<Repo>
where Repo: InterpidRepo + Clone + Send + Sync + 'static,

Source

pub fn new(repo: Repo) -> Self

Create a new connection.

Source

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

Source

pub fn cache_connection(&self) -> CacheConnection<Repo>

Get a cache connection

Source

pub fn into_inner(self) -> Repo

Consume the connection and return the inner repository

Trait Implementations§

Source§

impl<Repo> CacheRepo for IntrepidConnection<Repo>
where Repo: InterpidRepo + Send + Sync,

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,

Get a memo by URI
Source§

fn set_memo<'life0, 'async_trait, CacheCandidate>( &'life0 self, record: CacheCandidate, ) -> Pin<Box<dyn Future<Output = Result<CacheRecord, CacheRepoError>> + Send + 'async_trait>>
where CacheCandidate: IntoCache + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Set a memo with any type that implements IntoCache
Source§

impl<Repo: Clone> Clone for IntrepidConnection<Repo>

Source§

fn clone(&self) -> IntrepidConnection<Repo>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Repo: Debug> Debug for IntrepidConnection<Repo>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Repo> EventRepo for IntrepidConnection<Repo>
where Repo: InterpidRepo + Send + Sync,

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,

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>>
where EventCandidate: IntoEvent + Send + 'async_trait, Self: 'async_trait, 'life0: '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,

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,

Log the last read position for a subscriber. This leverages markers.
Source§

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,

Get the last read position for a subscriber.
Source§

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,

Get the last event position in the stream.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> InterpidRepo for T
where T: CacheRepo + EventRepo,

Source§

impl<T> MaybeSendSync for T