pub struct GeneratedMarkers { /* private fields */ }Expand description
A configured set of generated-file markers.
Markers are held folded to lower case and matched that way. A generator picks its own capitalisation, and the same banner arrives shouted from one tool and in sentence case from the next.
Implementations§
Source§impl GeneratedMarkers
impl GeneratedMarkers
Sourcepub fn new(markers: &[String], scan_lines: usize) -> Self
pub fn new(markers: &[String], scan_lines: usize) -> Self
Build a marker set from explicit markers and a scan depth.
Sourcepub fn with_additional(extra: &[String]) -> Self
pub fn with_additional(extra: &[String]) -> Self
The default markers plus extra, keeping the default scan depth.
Sourcepub fn is_generated(&self, head: &str) -> bool
pub fn is_generated(&self, head: &str) -> bool
Whether the head of a file marks it as generated.
head should be the file’s leading text; only the first configured
number of lines is inspected.
Trait Implementations§
Source§impl Clone for GeneratedMarkers
impl Clone for GeneratedMarkers
Source§fn clone(&self) -> GeneratedMarkers
fn clone(&self) -> GeneratedMarkers
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 GeneratedMarkers
impl Debug for GeneratedMarkers
Auto Trait Implementations§
impl Freeze for GeneratedMarkers
impl RefUnwindSafe for GeneratedMarkers
impl Send for GeneratedMarkers
impl Sync for GeneratedMarkers
impl Unpin for GeneratedMarkers
impl UnsafeUnpin for GeneratedMarkers
impl UnwindSafe for GeneratedMarkers
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