pub struct CodeOwners {
pub section_style: Option<SectionStyle>,
pub header: Option<String>,
pub rules: Vec<Rule>,
}Expand description
CODEOWNERS file configuration and generator.
Use CodeOwners::builder() to create a new instance.
§Example
use cuenv_codeowners::{CodeOwners, SectionStyle, Rule};
let codeowners = CodeOwners::builder()
.section_style(SectionStyle::Comment)
.header("Custom header comment")
.rule(Rule::new("*", ["@org/maintainers"]))
.rule(Rule::new("*.rs", ["@rust-team"]))
.build();
println!("{}", codeowners.generate());Fields§
§section_style: Option<SectionStyle>Section formatting style.
header: Option<String>Custom header comment for the file.
rules: Vec<Rule>Ownership rules.
Implementations§
Source§impl CodeOwners
impl CodeOwners
Sourcepub fn builder() -> CodeOwnersBuilder
pub fn builder() -> CodeOwnersBuilder
Create a new builder for constructing a CodeOwners configuration.
§Example
use cuenv_codeowners::CodeOwners;
let codeowners = CodeOwners::builder()
.rule(cuenv_codeowners::Rule::new("*", ["@fallback-team"]))
.build();Trait Implementations§
Source§impl Clone for CodeOwners
impl Clone for CodeOwners
Source§fn clone(&self) -> CodeOwners
fn clone(&self) -> CodeOwners
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 CodeOwners
impl Debug for CodeOwners
Source§impl Default for CodeOwners
impl Default for CodeOwners
Source§fn default() -> CodeOwners
fn default() -> CodeOwners
Returns the “default value” for a type. Read more
Source§impl PartialEq for CodeOwners
impl PartialEq for CodeOwners
impl Eq for CodeOwners
impl StructuralPartialEq for CodeOwners
Auto Trait Implementations§
impl Freeze for CodeOwners
impl RefUnwindSafe for CodeOwners
impl Send for CodeOwners
impl Sync for CodeOwners
impl Unpin for CodeOwners
impl UnwindSafe for CodeOwners
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