Skip to main content

Contiguous

Trait Contiguous 

Source
pub trait Contiguous: Send + Sync {
    type Item;

    // Required methods
    fn reader(
        &self,
    ) -> impl Future<Output = impl Reader<Item = Self::Item> + '_> + Send;
    fn size(&self) -> impl Future<Output = u64> + Send;
}
Expand description

Journals that support sequential append operations.

Maintains a monotonically increasing position counter where each appended item receives a unique position starting from 0.

Required Associated Types§

Source

type Item

The type of items stored in the journal.

Required Methods§

Source

fn reader( &self, ) -> impl Future<Output = impl Reader<Item = Self::Item> + '_> + Send

Acquire a reader guard that holds a consistent view of the journal.

While the returned guard exists, operations that need the journal’s internal write lock (such as append, prune, and rewind) may block until the guard is dropped. This ensures any position within reader.bounds() remains readable.

Source

fn size(&self) -> impl Future<Output = u64> + Send

Return the total number of items that have been appended to the journal.

This count is NOT affected by pruning. The next appended item will receive this position as its value. Equivalent to Reader::bounds.end.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<E, C, H> Contiguous for commonware_storage::journal::authenticated::Journal<E, C, H>
where E: Storage + Clock + Metrics, C: Contiguous<Item: EncodeShared>, H: Hasher,

Source§

impl<E: Clock + Storage + Metrics, A: CodecFixedShared> Contiguous for commonware_storage::journal::contiguous::fixed::Journal<E, A>

Source§

type Item = A

Source§

impl<E: Clock + Storage + Metrics, V: CodecShared> Contiguous for commonware_storage::journal::contiguous::variable::Journal<E, V>

Source§

type Item = V