Skip to main content

BranchRulesApi

Trait BranchRulesApi 

Source
pub trait BranchRulesApi {
    // Required methods
    fn branch_protection(
        &self,
        repo: &RepoRef,
        rule: &str,
    ) -> impl Future<Output = Result<Option<BranchProtection>, ForgeError>> + Send;
    fn branch_protections(
        &self,
        repo: &RepoRef,
    ) -> impl Future<Output = Result<Vec<BranchProtection>, ForgeError>> + Send;
    fn create_branch_protection(
        &self,
        repo: &RepoRef,
        body: &CreateBranchProtectionOption,
    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
    fn delete_branch_protection(
        &self,
        repo: &RepoRef,
        rule: &str,
    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
    fn patch_branch_protection(
        &self,
        repo: &RepoRef,
        rule: &str,
        body: &EditBranchProtectionOption,
    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
}
Expand description

The branch rule operations of the Forgejo API.

Required Methods§

Source

fn branch_protection( &self, repo: &RepoRef, rule: &str, ) -> impl Future<Output = Result<Option<BranchProtection>, ForgeError>> + Send

GET /repos/{owner}/{repo}/branch_protections/{rule}.

Ok(None) when the forge answers 404, which means the rule is absent.

Source

fn branch_protections( &self, repo: &RepoRef, ) -> impl Future<Output = Result<Vec<BranchProtection>, ForgeError>> + Send

GET /repos/{owner}/{repo}/branch_protections.

Source

fn create_branch_protection( &self, repo: &RepoRef, body: &CreateBranchProtectionOption, ) -> impl Future<Output = Result<(), ForgeError>> + Send

POST /repos/{owner}/{repo}/branch_protections.

Source

fn delete_branch_protection( &self, repo: &RepoRef, rule: &str, ) -> impl Future<Output = Result<(), ForgeError>> + Send

DELETE /repos/{owner}/{repo}/branch_protections/{rule}.

Source

fn patch_branch_protection( &self, repo: &RepoRef, rule: &str, body: &EditBranchProtectionOption, ) -> impl Future<Output = Result<(), ForgeError>> + Send

PATCH /repos/{owner}/{repo}/branch_protections/{rule}.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§