pub struct UmaDB { /* private fields */ }Expand description
EventStore implementing the DCBEventStoreSync interface
Implementations§
Source§impl UmaDB
impl UmaDB
Sourcepub fn new<P: AsRef<Path>>(path: P) -> DCBResult<Self>
pub fn new<P: AsRef<Path>>(path: P) -> DCBResult<Self>
Create a new EventStore at the given directory or file path. If a directory path is provided, a file named “uma.db” will be used inside it.
pub fn from_arc(mvcc: Arc<Mvcc>) -> Self
Sourcepub fn append_batch(
&self,
items: Vec<(Vec<DCBEvent>, Option<DCBAppendCondition>)>,
force_sequential_read: bool,
) -> DCBResult<Vec<DCBResult<u64>>>
pub fn append_batch( &self, items: Vec<(Vec<DCBEvent>, Option<DCBAppendCondition>)>, force_sequential_read: bool, ) -> DCBResult<Vec<DCBResult<u64>>>
Appends a batch of (events, condition) using a single writer/transaction. For each item, behaves like append():
- If condition is Some and matches any events (considering uncommitted writes), returns Err(IntegrityError) for that item and continues.
- If events is empty, returns Ok(0) for that item and continues.
- Otherwise performs unconditional append and records Ok(last_position) for that item.
At the end, commits the writer once. If commit fails, returns the commit error and discards per-item results.
Trait Implementations§
Source§impl DCBEventStoreSync for UmaDB
impl DCBEventStoreSync for UmaDB
Source§fn read(
&self,
query: Option<DCBQuery>,
start: Option<u64>,
backwards: bool,
limit: Option<u32>,
_subscribe: bool,
) -> DCBResult<Box<dyn DCBReadResponseSync + 'static>>
fn read( &self, query: Option<DCBQuery>, start: Option<u64>, backwards: bool, limit: Option<u32>, _subscribe: bool, ) -> DCBResult<Box<dyn DCBReadResponseSync + 'static>>
Reads events from the store based on the provided query and constraints Read more
Source§fn head(&self) -> DCBResult<Option<u64>>
fn head(&self) -> DCBResult<Option<u64>>
Returns the current head position of the event store, or None if empty Read more
Auto Trait Implementations§
impl Freeze for UmaDB
impl !RefUnwindSafe for UmaDB
impl Send for UmaDB
impl Sync for UmaDB
impl Unpin for UmaDB
impl !UnwindSafe for UmaDB
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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