pub enum PreservationRule {
Pattern(String),
Documentation,
FileHeader,
}Variants§
Pattern(String)
Preserve comments containing a specific pattern
Documentation
Preserve documentation comments
FileHeader
Preserve comments at the beginning of files (headers)
Implementations§
Source§impl PreservationRule
impl PreservationRule
pub fn matches(&self, comment: &CommentInfo) -> bool
Sourcepub fn pattern_matches(&self, pattern: &str) -> bool
pub fn pattern_matches(&self, pattern: &str) -> bool
Check if this rule is a pattern rule that matches the given pattern
Sourcepub fn documentation() -> Self
pub fn documentation() -> Self
Create a documentation preservation rule
Sourcepub fn file_header() -> Self
pub fn file_header() -> Self
Create a file header preservation rule
Source§impl PreservationRule
impl PreservationRule
Sourcepub fn default_rules() -> Vec<Self>
pub fn default_rules() -> Vec<Self>
Get default preservation rules for most projects
Sourcepub fn comprehensive_rules() -> Vec<Self>
pub fn comprehensive_rules() -> Vec<Self>
Get comprehensive preservation rules
Trait Implementations§
Source§impl Clone for PreservationRule
impl Clone for PreservationRule
Source§fn clone(&self) -> PreservationRule
fn clone(&self) -> PreservationRule
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PreservationRule
impl RefUnwindSafe for PreservationRule
impl Send for PreservationRule
impl Sync for PreservationRule
impl Unpin for PreservationRule
impl UnwindSafe for PreservationRule
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