Back to Eqiora docs Skip to main content

GraphStore

Trait GraphStore 

pub trait GraphStore: Send + Sync {
    // Required methods
    fn validate(&self, transaction: &Transaction) -> Vec<Diagnostic>;
    fn commit(
        &mut self,
        transaction: Transaction,
    ) -> Result<Committed, Vec<Diagnostic>>;
    fn snapshot(&self) -> Snapshot;
    fn revision(&self) -> Revision;
}
Description

Storage contract for the Graph Federation.

Required Methods§

fn validate(&self, transaction: &Transaction) -> Vec<Diagnostic>

Validate without committing. An empty result means the transaction would succeed against the current snapshot.

fn commit( &mut self, transaction: Transaction, ) -> Result<Committed, Vec<Diagnostic>>

Atomically apply a transaction and append its provenance record.

§Errors

Returns every violated invariant/precondition; no mutation is visible.

fn snapshot(&self) -> Snapshot

Obtain a snapshot-isolated immutable view.

fn revision(&self) -> Revision

Current federation revision.

Implementors§