pub trait Journal: Send + Sync {
// Required methods
fn append<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 MemoryRecord,
) -> Pin<Box<dyn Future<Output = MemoryResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn tail<'life0, 'async_trait>(
&'life0 self,
limit: usize,
) -> Pin<Box<dyn Future<Output = MemoryResult<Vec<MemoryRecord>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = MemoryResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Trait implemented by durable journals.
Required Methods§
Sourcefn append<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 MemoryRecord,
) -> Pin<Box<dyn Future<Output = MemoryResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn append<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 MemoryRecord,
) -> Pin<Box<dyn Future<Output = MemoryResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Appends a record to the journal.
Sourcefn tail<'life0, 'async_trait>(
&'life0 self,
limit: usize,
) -> Pin<Box<dyn Future<Output = MemoryResult<Vec<MemoryRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn tail<'life0, 'async_trait>(
&'life0 self,
limit: usize,
) -> Pin<Box<dyn Future<Output = MemoryResult<Vec<MemoryRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the most recent limit records, ordered oldest to newest.