pub struct FileEventStore<E, C> { /* private fields */ }Implementations§
Source§impl<E, C> FileEventStore<E, C>
impl<E, C> FileEventStore<E, C>
Sourcepub fn open(
path: impl AsRef<Path>,
codec: C,
options: FileStoreOptions,
) -> Result<Self>
pub fn open( path: impl AsRef<Path>, codec: C, options: FileStoreOptions, ) -> Result<Self>
Opens or creates a framed append-only event journal.
§Errors
Rejects invalid headers, checksum corruption, invalid restored event sequences, and partial tails in strict mode.
pub fn path(&self) -> &Path
Trait Implementations§
Source§impl<E, C> EventStore<E> for FileEventStore<E, C>
impl<E, C> EventStore<E> for FileEventStore<E, C>
Source§fn append(
&mut self,
stream: &StreamId,
expected: ExpectedVersion,
events: &[NewEvent<E>],
) -> Result<Vec<StoredEvent<E>>>
fn append( &mut self, stream: &StreamId, expected: ExpectedVersion, events: &[NewEvent<E>], ) -> Result<Vec<StoredEvent<E>>>
Atomically appends a batch to one stream. Read more
Source§fn append_owned(
&mut self,
stream: &StreamId,
expected: ExpectedVersion,
events: Vec<NewEvent<E>>,
) -> Result<Vec<StoredEvent<E>>>
fn append_owned( &mut self, stream: &StreamId, expected: ExpectedVersion, events: Vec<NewEvent<E>>, ) -> Result<Vec<StoredEvent<E>>>
Appends an owned batch without requiring callers to retain the inputs. Read more
Source§fn append_owned_receipt(
&mut self,
stream: &StreamId,
expected: ExpectedVersion,
events: Vec<NewEvent<E>>,
) -> Result<AppendReceipt>
fn append_owned_receipt( &mut self, stream: &StreamId, expected: ExpectedVersion, events: Vec<NewEvent<E>>, ) -> Result<AppendReceipt>
Appends an owned batch and returns positions without cloning committed
payloads back to the caller. Read more
fn load_stream( &self, stream: &StreamId, after: Option<u64>, ) -> Vec<StoredEvent<E>>
fn load_all(&self, after: Option<u64>, limit: usize) -> Vec<StoredEvent<E>>
fn stream_version(&self, stream: &StreamId) -> Option<u64>
fn len(&self) -> usize
fn is_empty(&self) -> bool
Auto Trait Implementations§
impl<E, C> Freeze for FileEventStore<E, C>where
C: Freeze,
impl<E, C> RefUnwindSafe for FileEventStore<E, C>where
C: RefUnwindSafe,
E: RefUnwindSafe,
impl<E, C> Send for FileEventStore<E, C>
impl<E, C> Sync for FileEventStore<E, C>
impl<E, C> Unpin for FileEventStore<E, C>
impl<E, C> UnsafeUnpin for FileEventStore<E, C>where
C: UnsafeUnpin,
impl<E, C> UnwindSafe for FileEventStore<E, C>where
C: UnwindSafe,
E: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more