Trait AsyncVersioningService

Source
pub trait AsyncVersioningService {
Show 18 methods // Required methods fn create_branch( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, request: CreateBranchRequest, ) -> impl Future<Output = Result<Branch, Error>> + Send; fn create_tag( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, request: CreateTagRequest, ) -> impl Future<Output = Result<Tag, Error>> + Send; fn get_commit( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, commit_id: CommitId, ) -> impl Future<Output = Result<Commit, Error>> + Send; fn batch_get_commits( &self, auth_: BearerToken, resource_and_commit_ids: BTreeSet<ResourceAndCommitId>, ) -> impl Future<Output = Result<BTreeSet<Commit>, Error>> + Send; fn get_commit_by_branch( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, branch_name: BranchName, ) -> impl Future<Output = Result<Commit, Error>> + Send; fn get_commit_by_tag( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, tag_name: TagName, ) -> impl Future<Output = Result<Commit, Error>> + Send; fn get_least_common_ancestor( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, request: GetLeastCommonAncestorRequest, ) -> impl Future<Output = Result<CommitId, Error>> + Send; fn get_commit_history( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, commit_id: CommitId, page_size: Option<i32>, next_page_token: Option<Token>, ) -> impl Future<Output = Result<CommitHistory, Error>> + Send; fn persist_commits( &self, auth_: BearerToken, request: BTreeSet<ResourceAndCommitId>, ) -> impl Future<Output = Result<(), Error>> + Send; fn get_branch( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, branch_name: BranchName, ) -> impl Future<Output = Result<Branch, Error>> + Send; fn get_branches( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, ) -> impl Future<Output = Result<Vec<Branch>, Error>> + Send; fn batch_get_branches( &self, auth_: BearerToken, resource_and_branches: BTreeSet<ResourceAndBranchName>, ) -> impl Future<Output = Result<BTreeSet<Branch>, Error>> + Send; fn get_tag( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, tag_name: TagName, ) -> impl Future<Output = Result<Tag, Error>> + Send; fn batch_get_tags( &self, auth_: BearerToken, resource_and_commits: BTreeSet<ResourceAndCommitId>, ) -> impl Future<Output = Result<BTreeSet<Tag>, Error>> + Send; fn get_tags_by_resource( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, ) -> impl Future<Output = Result<Vec<Tag>, Error>> + Send; fn delete_branch( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, branch_name: BranchName, ) -> impl Future<Output = Result<(), Error>> + Send; fn delete_branches( &self, auth_: BearerToken, resource_and_branches: BTreeSet<ResourceAndBranchName>, ) -> impl Future<Output = Result<(), Error>> + Send; fn delete_tag( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, tag_name: TagName, ) -> impl Future<Output = Result<(), Error>> + Send;
}
Expand description

This is the external-facing portion of VersioningService which gives clients access to functionality that doesn’t create new commits. The creation of new commits should be done via the resource-specific services.

Required Methods§

Source

fn create_branch( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, request: CreateBranchRequest, ) -> impl Future<Output = Result<Branch, Error>> + Send

Creates a mutable pointer to the provided commit. “Saves”/“commits” can be performed on this pointer. Throws if the name is already used as a commit pointer for this resource. Throws if the provided commit doesn’t exist.

Source

fn create_tag( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, request: CreateTagRequest, ) -> impl Future<Output = Result<Tag, Error>> + Send

Creates an immutable pointer to the provided commit. Throws if the name is already used as a commit pointer for this resource. Throws if the provided commit doesn’t exist.

Source

fn get_commit( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, commit_id: CommitId, ) -> impl Future<Output = Result<Commit, Error>> + Send

Throws if the commit doesn’t exist.

Source

fn batch_get_commits( &self, auth_: BearerToken, resource_and_commit_ids: BTreeSet<ResourceAndCommitId>, ) -> impl Future<Output = Result<BTreeSet<Commit>, Error>> + Send

Filters out resources that are not authorized.

Source

fn get_commit_by_branch( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, branch_name: BranchName, ) -> impl Future<Output = Result<Commit, Error>> + Send

Returns the commit pointed to by the branch. Throws if the branch doesn’t exist.

Source

fn get_commit_by_tag( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, tag_name: TagName, ) -> impl Future<Output = Result<Commit, Error>> + Send

Returns the commit pointed to by the tag. Throws if the tag doesn’t exist.

Source

fn get_least_common_ancestor( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, request: GetLeastCommonAncestorRequest, ) -> impl Future<Output = Result<CommitId, Error>> + Send

Returns the least common ancestor of the two commits. Throws if either commit doesn’t exist.

Source

fn get_commit_history( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, commit_id: CommitId, page_size: Option<i32>, next_page_token: Option<Token>, ) -> impl Future<Output = Result<CommitHistory, Error>> + Send

Returns the commit history sorted by creation time descending. Excludes working state commits. Throws if the commit doesn’t exist.

Source

fn persist_commits( &self, auth_: BearerToken, request: BTreeSet<ResourceAndCommitId>, ) -> impl Future<Output = Result<(), Error>> + Send

Persists the commits so that they are not compacted. This operation is atomic - either all commits are persisted or none are (in the case of an error).

Source

fn get_branch( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, branch_name: BranchName, ) -> impl Future<Output = Result<Branch, Error>> + Send

Throws if the branch doesn’t exist.

Source

fn get_branches( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, ) -> impl Future<Output = Result<Vec<Branch>, Error>> + Send

Returns all branches for the resource in order of most recently updated.

Source

fn batch_get_branches( &self, auth_: BearerToken, resource_and_branches: BTreeSet<ResourceAndBranchName>, ) -> impl Future<Output = Result<BTreeSet<Branch>, Error>> + Send

Omits branches that are not authorized.

Source

fn get_tag( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, tag_name: TagName, ) -> impl Future<Output = Result<Tag, Error>> + Send

Throws if the tag doesn’t exist.

Source

fn batch_get_tags( &self, auth_: BearerToken, resource_and_commits: BTreeSet<ResourceAndCommitId>, ) -> impl Future<Output = Result<BTreeSet<Tag>, Error>> + Send

Omits tags that are not authorized.

Source

fn get_tags_by_resource( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, ) -> impl Future<Output = Result<Vec<Tag>, Error>> + Send

Returns all tags for the resource in order of most recently created.

Source

fn delete_branch( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, branch_name: BranchName, ) -> impl Future<Output = Result<(), Error>> + Send

Deletes the branch pointer. Throws if the branch doesn’t exist. Throws if you attempt to delete the “main” branch.

Source

fn delete_branches( &self, auth_: BearerToken, resource_and_branches: BTreeSet<ResourceAndBranchName>, ) -> impl Future<Output = Result<(), Error>> + Send

Deletes the branch pointers. Throws if any resource or branch is non-existent or unauthorized. Throws if any attempt is made to delete “main”.

Source

fn delete_tag( &self, auth_: BearerToken, resource_rid: ResourceIdentifier, tag_name: TagName, ) -> impl Future<Output = Result<(), Error>> + Send

Deletes the tag pointer. Throws if the tag 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§