Trait AsyncInternalVersioningService

Source
pub trait AsyncInternalVersioningService {
    // Required methods
    fn init_resource_versioning(
        &self,
        auth_: BearerToken,
        resource_rid: ResourceIdentifier,
        request: InitResourceVersioningRequest,
    ) -> impl Future<Output = Result<BranchAndCommit, Error>> + Send;
    fn save_working_state(
        &self,
        auth_: BearerToken,
        resource_rid: ResourceIdentifier,
        branch_name: BranchName,
        request: SaveWorkingStateRequest,
    ) -> impl Future<Output = Result<BranchAndCommit, Error>> + Send;
    fn commit(
        &self,
        auth_: BearerToken,
        resource_rid: ResourceIdentifier,
        branch_name: BranchName,
        request: CommitRequest,
    ) -> impl Future<Output = Result<BranchAndCommit, Error>> + Send;
    fn compact_commits(
        &self,
        auth_: BearerToken,
        resource_rid: ResourceIdentifier,
        request: CompactCommitsRequest,
    ) -> impl Future<Output = Result<BTreeSet<CommitId>, Error>> + Send;
}
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, ) -> impl Future<Output = Result<BranchAndCommit, Error>> + Send

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, ) -> impl Future<Output = Result<BranchAndCommit, Error>> + Send

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, ) -> impl Future<Output = Result<BranchAndCommit, Error>> + Send

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, ) -> impl Future<Output = Result<BTreeSet<CommitId>, Error>> + Send

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.

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§