Skip to main content

MemoryEventStore

Struct MemoryEventStore 

Source
pub struct MemoryEventStore<E> { /* private fields */ }
Expand description

Append-only in-memory event store with optimistic concurrency checks.

Implementations§

Source§

impl<E> MemoryEventStore<E>

Source

pub fn new() -> Self

Creates an empty event store.

Trait Implementations§

Source§

impl<E: Debug> Debug for MemoryEventStore<E>

Source§

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

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

impl<E> Default for MemoryEventStore<E>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<E> EventStore<E> for MemoryEventStore<E>
where E: DomainEvent + Clone,

Source§

fn append<'a>( &'a self, stream_id: &'a StreamId, expected: ExpectedVersion, events: Vec<EventEnvelope<E>>, ) -> BoxFuture<'a, SoapResult<AppendResult>>

Atomically appends events if the stream version expectation is met.
Source§

fn load<'a>( &'a self, stream_id: &'a StreamId, after: Option<StreamVersion>, ) -> BoxFuture<'a, SoapResult<Vec<RecordedEvent<E>>>>

Loads a stream, optionally starting after a committed version.
Source§

fn read_all( &self, after: Option<GlobalPosition>, limit: usize, ) -> BoxFuture<'_, SoapResult<Vec<RecordedEvent<E>>>>

Reads the global log strictly after a position, in ascending order.

Auto Trait Implementations§

§

impl<E> !Freeze for MemoryEventStore<E>

§

impl<E> RefUnwindSafe for MemoryEventStore<E>

§

impl<E> Send for MemoryEventStore<E>
where E: Send,

§

impl<E> Sync for MemoryEventStore<E>
where E: Send,

§

impl<E> Unpin for MemoryEventStore<E>
where E: Unpin,

§

impl<E> UnsafeUnpin for MemoryEventStore<E>

§

impl<E> UnwindSafe for MemoryEventStore<E>

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.