Trait CommitStore

Source
pub trait CommitStore {
    // Required methods
    fn add_commit(&self, commit: Commit) -> Result<(), CommitStoreError>;
    fn get_commit_by_commit_num(
        &self,
        commit_num: i64,
    ) -> Result<Option<Commit>, CommitStoreError>;
    fn get_current_commit_id(&self) -> Result<Option<String>, CommitStoreError>;
    fn get_current_service_commits(
        &self,
    ) -> Result<Vec<Commit>, CommitStoreError>;
    fn get_next_commit_num(&self) -> Result<i64, CommitStoreError>;
    fn resolve_fork(&self, commit_num: i64) -> Result<(), CommitStoreError>;
    fn create_db_commit_from_commit_event(
        &self,
        event: &CommitEvent,
    ) -> Result<Option<Commit>, CommitStoreError>;
}

Required Methods§

Source

fn add_commit(&self, commit: Commit) -> Result<(), CommitStoreError>

Adds an commit to the underlying storage

§Arguments
  • commit - The commit to be added
Source

fn get_commit_by_commit_num( &self, commit_num: i64, ) -> Result<Option<Commit>, CommitStoreError>

Gets a commit from the underlying storage

§Arguments
  • commit_num - The commit to be fetched
Source

fn get_current_commit_id(&self) -> Result<Option<String>, CommitStoreError>

Gets the current commit ID from the underlying storage

Source

fn get_current_service_commits(&self) -> Result<Vec<Commit>, CommitStoreError>

Gets all the current commits on services.

This returns the latest commit values for all commits where commit.service_id is not None.

Source

fn get_next_commit_num(&self) -> Result<i64, CommitStoreError>

Gets the next commit number from the underlying storage

Source

fn resolve_fork(&self, commit_num: i64) -> Result<(), CommitStoreError>

Resolves a fork

§Arguments
  • commit_num - The commit to be fetched
Source

fn create_db_commit_from_commit_event( &self, event: &CommitEvent, ) -> Result<Option<Commit>, CommitStoreError>

Creates a commit model from a commit event

§Arguments
  • event - The commit event to be processed

Implementations on Foreign Types§

Source§

impl<CS> CommitStore for Box<CS>
where CS: CommitStore + ?Sized,

Implementors§