Trait InternalVersioningService

Source
pub trait InternalVersioningService {
    // Required methods
    fn init_resource_versioning(
        &self,
        auth_: BearerToken,
        resource_rid: ResourceIdentifier,
        request: InitResourceVersioningRequest,
    ) -> Result<BranchAndCommit, Error>;
    fn save_working_state(
        &self,
        auth_: BearerToken,
        resource_rid: ResourceIdentifier,
        branch_name: BranchName,
        request: SaveWorkingStateRequest,
    ) -> Result<BranchAndCommit, Error>;
    fn commit(
        &self,
        auth_: BearerToken,
        resource_rid: ResourceIdentifier,
        branch_name: BranchName,
        request: CommitRequest,
    ) -> Result<BranchAndCommit, Error>;
    fn compact_commits(
        &self,
        auth_: BearerToken,
        resource_rid: ResourceIdentifier,
        request: CompactCommitsRequest,
    ) -> Result<BTreeSet<CommitId>, Error>;
}
Expand description

These endpoints are not intended to be used directly by clients, since they require saving resource-specific state associated with new commits.

Required Methods§

Source

fn init_resource_versioning( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, request: InitResourceVersioningRequest, ) -> Result<BranchAndCommit, Error>

Creates a root commit (no parents) and a “main” branch pointing to that commit, for the given resource. Throws if the resource already has a commit graph.

Source

fn save_working_state( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, branch_name: BranchName, request: SaveWorkingStateRequest, ) -> Result<BranchAndCommit, Error>

Creates a non-permanent commit on the given branch, Throws if the branch doesn’t exist. Throws if latestCommit is passed and is not the latest commit.

Source

fn commit( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, branch_name: BranchName, request: CommitRequest, ) -> Result<BranchAndCommit, Error>

Creates a new permanent commit on the given branch. Throws if the branch doesn’t exist. Throws if latestCommit is passed and is not the latest commit.

Source

fn compact_commits( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, request: CompactCommitsRequest, ) -> Result<BTreeSet<CommitId>, Error>

Compacts the commit graph for the resource by deleting working state commits that match the provided strategy. Persists commits that are pointed to by branches. Returns the set of commits that were compacted. Throws if the resource doesn’t exist.

Implementors§