pub struct RedbRuntimeEventJournal { /* private fields */ }Expand description
Redb-backed implementation of RuntimeEventJournalPort.
Arc<Database> allows cheap cloning — all clones share the same underlying
redb file handle. redb::Database is Send + Sync.
Implementations§
Source§impl RedbRuntimeEventJournal
impl RedbRuntimeEventJournal
Sourcepub async fn new(
path: impl Into<PathBuf>,
options: RedbJournalOptions,
) -> Result<Self, CamelError>
pub async fn new( path: impl Into<PathBuf>, options: RedbJournalOptions, ) -> Result<Self, CamelError>
Open (or create) the redb database at path.
Parent directories are created if they do not exist.
Both tables are initialised on first open.
Uses tokio::task::spawn_blocking because Database::open is blocking.
Sourcepub async fn inspect(
path: impl Into<PathBuf>,
filter: JournalInspectFilter,
) -> Result<Vec<JournalEntry>, CamelError>
pub async fn inspect( path: impl Into<PathBuf>, filter: JournalInspectFilter, ) -> Result<Vec<JournalEntry>, CamelError>
Open an existing database at path and return entries (newest-first, up to filter.limit).
Uses Database::open + begin_read — concurrent with a live writer on the same file.
inspect is an offline utility: it does NOT require a live RedbRuntimeEventJournal instance.
Trait Implementations§
Source§impl Clone for RedbRuntimeEventJournal
impl Clone for RedbRuntimeEventJournal
Source§fn clone(&self) -> RedbRuntimeEventJournal
fn clone(&self) -> RedbRuntimeEventJournal
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl RuntimeEventJournalPort for RedbRuntimeEventJournal
impl RuntimeEventJournalPort for RedbRuntimeEventJournal
Source§fn append_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
events: &'life1 [RuntimeEvent],
) -> Pin<Box<dyn Future<Output = Result<(), DomainError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn append_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
events: &'life1 [RuntimeEvent],
) -> Pin<Box<dyn Future<Output = Result<(), DomainError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Append a batch of runtime events to a durable journal.
Source§fn load_all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<RuntimeEvent>, DomainError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<RuntimeEvent>, DomainError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load the complete journal stream (append order).
Source§fn append_command_id<'life0, 'life1, 'async_trait>(
&'life0 self,
command_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), DomainError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn append_command_id<'life0, 'life1, 'async_trait>(
&'life0 self,
command_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), DomainError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Append a “command seen” marker to durable dedup journal. Read more
Source§fn remove_command_id<'life0, 'life1, 'async_trait>(
&'life0 self,
command_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), DomainError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_command_id<'life0, 'life1, 'async_trait>(
&'life0 self,
command_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), DomainError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Append a “command forgotten” marker to durable dedup journal. Read more
Auto Trait Implementations§
impl Freeze for RedbRuntimeEventJournal
impl !RefUnwindSafe for RedbRuntimeEventJournal
impl Send for RedbRuntimeEventJournal
impl Sync for RedbRuntimeEventJournal
impl Unpin for RedbRuntimeEventJournal
impl UnsafeUnpin for RedbRuntimeEventJournal
impl !UnwindSafe for RedbRuntimeEventJournal
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