Crate event_store[][src]

Expand description

EventStore

The EventStore will allow you to deal with every aspects of the event sourcing part of Chekov.

Appending an event

Events are appended by using the fluent API exposed at the root level of the event_store crate:

use event_store::prelude::*;

let stream_uuid = Uuid::new_v4().to_string();
let my_event = MyEvent { account_id: Uuid::new_v4() };

event_store::append()
  .event(&my_event)?
  .to(&stream_uuid)?
  .execute(event_store)
  .await;

Reading from stream

A Stream can be read with the fluent API exposed at the root level of the event_store crate:

use event_store::prelude::*;

let stream_uuid = Uuid::new_v4().to_string();

event_store::read()
  .stream(&stream_uuid)?
  .from(ReadVersion::Origin)
  .limit(10)
  .execute(event_store)
  .await;

Modules

Structs

An EventStore that hold a storage connection

Builder use to simplify the EventStore creation

Traits

Represent event that can be handled by an EventStore

Functions

Create an Appender to append events

Create a Reader to read a stream