pub struct Transient<Store, Subscriber> { /* private fields */ }Expand description
Subscription type which gets deleted once the process using it
gets terminated.
Useful for in-memory or one-off Projections.
Implementations§
Source§impl<Store, Subscriber> Transient<Store, Subscriber>
impl<Store, Subscriber> Transient<Store, Subscriber>
Sourcepub fn new(store: Store, subscriber: Subscriber) -> Self
pub fn new(store: Store, subscriber: Subscriber) -> Self
Creates a new Subscription using the specified EventStore
and EventSubscriber to create the SubscriptionStream from.
Sourcepub fn from(self, sequence_number: u32) -> Self
pub fn from(self, sequence_number: u32) -> Self
Specifies the sequence number of the Event the SubscriptionStream
should start from when calling run.
Trait Implementations§
Source§impl<Store, Subscriber> Subscription for Transient<Store, Subscriber>where
Store: EventStore + Send + Sync,
Subscriber: EventSubscriber<SourceId = <Store as EventStore>::SourceId, Event = <Store as EventStore>::Event> + Send + Sync,
<Store as EventStore>::SourceId: Send + Sync,
<Store as EventStore>::Event: Send + Sync,
<Store as EventStore>::Error: StdError + Send + Sync + 'static,
<Subscriber as EventSubscriber>::Error: StdError + Send + Sync + 'static,
impl<Store, Subscriber> Subscription for Transient<Store, Subscriber>where
Store: EventStore + Send + Sync,
Subscriber: EventSubscriber<SourceId = <Store as EventStore>::SourceId, Event = <Store as EventStore>::Event> + Send + Sync,
<Store as EventStore>::SourceId: Send + Sync,
<Store as EventStore>::Event: Send + Sync,
<Store as EventStore>::Error: StdError + Send + Sync + 'static,
<Subscriber as EventSubscriber>::Error: StdError + Send + Sync + 'static,
Source§type SourceId = <Store as EventStore>::SourceId
type SourceId = <Store as EventStore>::SourceId
Type of the Source id, typically an
AggregateId.Source§type Event = <Store as EventStore>::Event
type Event = <Store as EventStore>::Event
Event type stored in the
EventStore, typically an Aggregate::Event.Source§type Error = Error
type Error = Error
Possible errors returned when receiving events from the notification channel.
Source§fn resume(
&self,
) -> BoxFuture<'_, Result<SubscriptionStream<'_, Self>, Self::Error>>
fn resume( &self, ) -> BoxFuture<'_, Result<SubscriptionStream<'_, Self>, Self::Error>>
Resumes the current state of a
Subscription by returning the EventStream,
starting from the last event processed by the Subscription.Auto Trait Implementations§
impl<Store, Subscriber> Freeze for Transient<Store, Subscriber>
impl<Store, Subscriber> RefUnwindSafe for Transient<Store, Subscriber>where
Store: RefUnwindSafe,
Subscriber: RefUnwindSafe,
impl<Store, Subscriber> Send for Transient<Store, Subscriber>
impl<Store, Subscriber> Sync for Transient<Store, Subscriber>
impl<Store, Subscriber> Unpin for Transient<Store, Subscriber>
impl<Store, Subscriber> UnwindSafe for Transient<Store, Subscriber>where
Store: UnwindSafe,
Subscriber: 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