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§
Sourcefn branch_protection(
&self,
repo: &RepoRef,
rule: &str,
) -> impl Future<Output = Result<Option<BranchProtection>, ForgeError>> + Send
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.
Sourcefn branch_protections(
&self,
repo: &RepoRef,
) -> impl Future<Output = Result<Vec<BranchProtection>, ForgeError>> + Send
fn branch_protections( &self, repo: &RepoRef, ) -> impl Future<Output = Result<Vec<BranchProtection>, ForgeError>> + Send
GET /repos/{owner}/{repo}/branch_protections.
Sourcefn create_branch_protection(
&self,
repo: &RepoRef,
body: &CreateBranchProtectionOption,
) -> impl Future<Output = Result<(), ForgeError>> + Send
fn create_branch_protection( &self, repo: &RepoRef, body: &CreateBranchProtectionOption, ) -> impl Future<Output = Result<(), ForgeError>> + Send
POST /repos/{owner}/{repo}/branch_protections.
Sourcefn delete_branch_protection(
&self,
repo: &RepoRef,
rule: &str,
) -> impl Future<Output = Result<(), ForgeError>> + Send
fn delete_branch_protection( &self, repo: &RepoRef, rule: &str, ) -> impl Future<Output = Result<(), ForgeError>> + Send
DELETE /repos/{owner}/{repo}/branch_protections/{rule}.
Sourcefn patch_branch_protection(
&self,
repo: &RepoRef,
rule: &str,
body: &EditBranchProtectionOption,
) -> impl Future<Output = Result<(), ForgeError>> + Send
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".