Transient

Struct Transient 

Source
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>

Source

pub fn new(store: Store, subscriber: Subscriber) -> Self

Creates a new Subscription using the specified EventStore and EventSubscriber to create the SubscriptionStream from.

Source

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,

Source§

type SourceId = <Store as EventStore>::SourceId

Type of the Source id, typically an AggregateId.
Source§

type Event = <Store as EventStore>::Event

Event type stored in the EventStore, typically an Aggregate::Event.
Source§

type Error = Error

Possible errors returned when receiving events from the notification channel.
Source§

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.
Source§

fn checkpoint(&self, version: u32) -> BoxFuture<'_, Result<(), Self::Error>>

Saves the provided version (or sequence number) as the latest version processed.

Auto Trait Implementations§

§

impl<Store, Subscriber> Freeze for Transient<Store, Subscriber>
where Store: Freeze, Subscriber: Freeze,

§

impl<Store, Subscriber> RefUnwindSafe for Transient<Store, Subscriber>
where Store: RefUnwindSafe, Subscriber: RefUnwindSafe,

§

impl<Store, Subscriber> Send for Transient<Store, Subscriber>
where Store: Send, Subscriber: Send,

§

impl<Store, Subscriber> Sync for Transient<Store, Subscriber>
where Store: Sync, Subscriber: Sync,

§

impl<Store, Subscriber> Unpin for Transient<Store, Subscriber>
where Store: Unpin, Subscriber: Unpin,

§

impl<Store, Subscriber> UnwindSafe for Transient<Store, Subscriber>
where Store: UnwindSafe, Subscriber: 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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.