OpStore

Trait OpStore 

Source
pub trait OpStore:
    Any
    + Send
    + Sync
    + Debug {
    // Required methods
    fn name(&self) -> &str;
    fn root_operation_id(&self) -> &OperationId;
    fn read_view<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 ViewId,
    ) -> Pin<Box<dyn Future<Output = OpStoreResult<View>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn write_view<'life0, 'life1, 'async_trait>(
        &'life0 self,
        contents: &'life1 View,
    ) -> Pin<Box<dyn Future<Output = OpStoreResult<ViewId>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn read_operation<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 OperationId,
    ) -> Pin<Box<dyn Future<Output = OpStoreResult<Operation>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn write_operation<'life0, 'life1, 'async_trait>(
        &'life0 self,
        contents: &'life1 Operation,
    ) -> Pin<Box<dyn Future<Output = OpStoreResult<OperationId>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn resolve_operation_id_prefix<'life0, 'life1, 'async_trait>(
        &'life0 self,
        prefix: &'life1 HexPrefix,
    ) -> Pin<Box<dyn Future<Output = OpStoreResult<PrefixResolution<OperationId>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn gc(
        &self,
        head_ids: &[OperationId],
        keep_newer: SystemTime,
    ) -> OpStoreResult<()>;
}

Required Methods§

Source

fn name(&self) -> &str

Source

fn root_operation_id(&self) -> &OperationId

Source

fn read_view<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 ViewId, ) -> Pin<Box<dyn Future<Output = OpStoreResult<View>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn write_view<'life0, 'life1, 'async_trait>( &'life0 self, contents: &'life1 View, ) -> Pin<Box<dyn Future<Output = OpStoreResult<ViewId>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn read_operation<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 OperationId, ) -> Pin<Box<dyn Future<Output = OpStoreResult<Operation>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn write_operation<'life0, 'life1, 'async_trait>( &'life0 self, contents: &'life1 Operation, ) -> Pin<Box<dyn Future<Output = OpStoreResult<OperationId>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn resolve_operation_id_prefix<'life0, 'life1, 'async_trait>( &'life0 self, prefix: &'life1 HexPrefix, ) -> Pin<Box<dyn Future<Output = OpStoreResult<PrefixResolution<OperationId>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Resolves an unambiguous operation ID prefix.

Source

fn gc( &self, head_ids: &[OperationId], keep_newer: SystemTime, ) -> OpStoreResult<()>

Prunes unreachable operations and views.

All operations and views reachable from the head_ids won’t be removed. In addition to that, objects created after keep_newer will be preserved. This mitigates a risk of deleting new heads created concurrently by another process.

Implementations§

Source§

impl dyn OpStore

Source

pub fn downcast_ref<T: OpStore>(&self) -> Option<&T>

Returns reference of the implementation type.

Implementors§