pub struct CodeownersBuilder { /* private fields */ }Expand description
Builder for Codeowners.
§Example
use cuenv_codeowners::{Codeowners, Platform, Rule};
let codeowners = Codeowners::builder()
.platform(Platform::Github)
.header("Code ownership rules")
.rule(Rule::new("*", ["@org/maintainers"])) // Catch-all rule
.rule(Rule::new("*.rs", ["@rust-team"]))
.rules([
Rule::new("/docs/**", ["@docs-team"]),
Rule::new("/ci/**", ["@devops"]),
])
.build();Implementations§
Source§impl CodeownersBuilder
impl CodeownersBuilder
Sourcepub fn path(self, path: impl Into<String>) -> Self
pub fn path(self, path: impl Into<String>) -> Self
Set a custom output path.
Overrides the platform’s default path.
Sourcepub fn header(self, header: impl Into<String>) -> Self
pub fn header(self, header: impl Into<String>) -> Self
Set a custom header comment.
The header will be added at the top of the file with # prefixes.
Sourcepub fn rules(self, rules: impl IntoIterator<Item = Rule>) -> Self
pub fn rules(self, rules: impl IntoIterator<Item = Rule>) -> Self
Add multiple rules.
Sourcepub fn build(self) -> Codeowners
pub fn build(self) -> Codeowners
Build the Codeowners configuration.
Trait Implementations§
Source§impl Clone for CodeownersBuilder
impl Clone for CodeownersBuilder
Source§fn clone(&self) -> CodeownersBuilder
fn clone(&self) -> CodeownersBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CodeownersBuilder
impl Debug for CodeownersBuilder
Source§impl Default for CodeownersBuilder
impl Default for CodeownersBuilder
Source§fn default() -> CodeownersBuilder
fn default() -> CodeownersBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CodeownersBuilder
impl RefUnwindSafe for CodeownersBuilder
impl Send for CodeownersBuilder
impl Sync for CodeownersBuilder
impl Unpin for CodeownersBuilder
impl UnwindSafe for CodeownersBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more