Skip to main content

EventStore

Struct EventStore 

Source
pub struct EventStore { /* private fields */ }

Implementations§

Source§

impl EventStore

Source

pub fn open( path: PathBuf, encryptor: Option<Encryptor>, worker_id: u16, ) -> Result<Self>

Source

pub fn open_read_only( path: PathBuf, encryptor: Option<Encryptor>, ) -> Result<Self>

Source

pub fn storage_usage_bytes(&self) -> Result<u64>

Source

pub fn counts(&self) -> Result<StoreCounts>

Source

pub fn prepare_payload_from_patch( &self, aggregate_type: &str, aggregate_id: &str, patch_value: &Value, ) -> Result<Value>

Source

pub fn append(&self, input: AppendEvent) -> Result<EventRecord>

Source

pub fn append_imported_event(&self, record: EventRecord) -> Result<()>

Source

pub fn transaction(&self) -> Result<Transaction<'_>>

Source

pub fn get_aggregate_state( &self, aggregate_type: &str, aggregate_id: &str, ) -> Result<AggregateState>

Source

pub fn parse_timestamp_cursor( &self, raw: &str, kind: TimestampIndexKind, descending: bool, ) -> Result<AggregateCursor>

Source

pub fn list_events( &self, aggregate_type: &str, aggregate_id: &str, ) -> Result<Vec<EventRecord>>

Source

pub fn merkle_root_at( &self, aggregate_type: &str, aggregate_id: &str, version: u64, ) -> Result<Option<String>>

Source

pub fn event_hashes( &self, aggregate_type: &str, aggregate_id: &str, ) -> Result<Option<Vec<String>>>

Source

pub fn event_by_version( &self, aggregate_type: &str, aggregate_id: &str, version: u64, ) -> Result<Option<EventRecord>>

Source

pub fn list_events_paginated( &self, aggregate_type: &str, aggregate_id: &str, skip: usize, take: Option<usize>, ) -> Result<Vec<EventRecord>>

Source

pub fn events_after( &self, aggregate_type: &str, aggregate_id: &str, from_version: u64, limit: Option<usize>, ) -> Result<Vec<EventRecord>>

Source

pub fn events_paginated( &self, scope: EventQueryScope<'_>, archive_scope: EventArchiveScope, skip: usize, take: Option<usize>, sort: Option<&[EventSort]>, filter: Option<&FilterExpr>, ) -> Result<Vec<EventRecord>>

Source

pub fn find_event_by_id( &self, event_id: SnowflakeId, ) -> Result<Option<EventRecord>>

Source

pub fn aggregate_version( &self, aggregate_type: &str, aggregate_id: &str, ) -> Result<Option<u64>>

Source

pub fn list_aggregate_ids(&self, aggregate_type: &str) -> Result<Vec<String>>

Source

pub fn verify(&self, aggregate_type: &str, aggregate_id: &str) -> Result<String>

Source

pub fn create_snapshot( &self, aggregate_type: &str, aggregate_id: &str, comment: Option<String>, ) -> Result<SnapshotRecord>

Source

pub fn list_snapshots( &self, aggregate_type: Option<&str>, aggregate_id: Option<&str>, version: Option<u64>, ) -> Result<Vec<SnapshotRecord>>

Source

pub fn find_snapshot_by_id( &self, snapshot_id: SnowflakeId, ) -> Result<Option<SnapshotRecord>>

Source

pub fn set_archive( &self, aggregate_type: &str, aggregate_id: &str, archived: bool, comment: Option<String>, ) -> Result<AggregateState>

Source

pub fn aggregates(&self) -> Vec<AggregateState>

Source

pub fn aggregates_paginated( &self, skip: usize, take: Option<usize>, ) -> Vec<AggregateState>

Source

pub fn aggregates_paginated_with_transform<F>( &self, skip: usize, take: Option<usize>, sort: Option<&[AggregateSort]>, scope: AggregateQueryScope, cursor: Option<&AggregateCursor>, transform: F, ) -> Vec<AggregateState>

Source

pub fn aggregates_paginated_without_state<F>( &self, skip: usize, take: Option<usize>, sort: Option<&[AggregateSort]>, scope: AggregateQueryScope, cursor: Option<&AggregateCursor>, transform: F, ) -> Vec<AggregateState>

Source

pub fn aggregates_page_with_transform<F>( &self, cursor: Option<&AggregateCursor>, take: usize, scope: AggregateQueryScope, include_state: bool, transform: F, ) -> Result<(Vec<AggregateState>, Option<AggregateCursor>)>

Source

pub fn aggregates_page_without_state<F>( &self, cursor: Option<&AggregateCursor>, take: usize, scope: AggregateQueryScope, transform: F, ) -> Result<(Vec<AggregateState>, Option<AggregateCursor>)>

Source

pub fn aggregates_page( &self, cursor: Option<&AggregateCursor>, take: usize, scope: AggregateQueryScope, ) -> Result<(Vec<AggregateState>, Option<AggregateCursor>)>

Source

pub fn events_page( &self, scope: EventQueryScope<'_>, archive_scope: EventArchiveScope, cursor: Option<&EventCursor>, take: usize, filter: Option<&FilterExpr>, ) -> Result<(Vec<EventRecord>, Option<EventCursor>)>

Source

pub fn aggregate_positions(&self) -> Result<Vec<AggregatePositionEntry>>

Source

pub fn create_aggregate( &self, aggregate_type: &str, aggregate_id: &str, ) -> Result<()>

Source

pub fn remove_aggregate( &self, aggregate_type: &str, aggregate_id: &str, ) -> Result<()>

Source

pub fn update_reference_index( &self, tenant: &str, aggregate_type: &str, aggregate_id: &str, references: &[(String, String)], ) -> Result<()>

Source

pub fn clear_reference_index( &self, tenant: &str, aggregate_type: &str, aggregate_id: &str, ) -> Result<()>

Source

pub fn referrers_for( &self, tenant: &str, target: &str, ) -> Result<Vec<(String, String, String)>>

Source

pub fn referrers_for_any_tenant( &self, target: &str, ) -> Result<Vec<(String, String, String, String)>>

Auto Trait Implementations§

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<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more