[][src]Struct eventually::Projector

pub struct Projector<P, S> where
    P: Projection
{ /* fields omitted */ }

A Projector manages the state of a single Projection by opening a long-running stream of all events coming from the EventStore.

New instances of a Projector are obtainable through a ProjectorBuilder instance.

The Projector will start updating the Projection state when run is called.

At each update, the Projector will broadcast the latest version of the Projection on a Stream obtainable through watch.

Implementations

impl<P, S> Projector<P, S> where
    P: Projection,
    S: Subscription<SourceId = <P as Projection>::SourceId, Event = <P as Projection>::Event>,
    <P as Projection>::SourceId: Debug,
    <P as Projection>::Event: Debug,
    <P as Projection>::Error: Error,
    <P as Projection>::Error: Send,
    <P as Projection>::Error: Sync,
    <P as Projection>::Error: 'static,
    <S as Subscription>::Error: Error,
    <S as Subscription>::Error: Send,
    <S as Subscription>::Error: Sync,
    <S as Subscription>::Error: 'static, 
[src]

pub fn new(projection: Arc<RwLock<P>>, subscription: S) -> Projector<P, S>[src]

Create a new Projector from the provided Projection and Subscription values.

pub async fn run(&'_ mut self) -> Result<(), Error>[src]

Starts the update of the Projection by processing all the events coming from the EventStore.

Auto Trait Implementations

impl<P, S> !RefUnwindSafe for Projector<P, S>

impl<P, S> Send for Projector<P, S> where
    P: Send + Sync,
    S: Send

impl<P, S> Sync for Projector<P, S> where
    P: Send + Sync,
    S: Sync

impl<P, S> Unpin for Projector<P, S> where
    S: Unpin

impl<P, S> !UnwindSafe for Projector<P, S>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.