pub struct NamedFileTypes { /* private fields */ }Expand description
Named, reusable groups of file-name or repository-relative glob patterns.
Implementations§
Source§impl NamedFileTypes
impl NamedFileTypes
pub fn new() -> Self
Sourcepub fn defaults() -> Self
pub fn defaults() -> Self
Creates a catalog containing common source, markup, data, and build
file types. No type is selected until Self::select is called.
Sourcepub fn with_defaults(self) -> Self
pub fn with_defaults(self) -> Self
Adds built-in definitions without replacing caller-defined names.
Sourcepub fn with_type<I, S>(self, name: impl Into<String>, extensions: I) -> Self
pub fn with_type<I, S>(self, name: impl Into<String>, extensions: I) -> Self
Adds or replaces a named extension group.
Extensions retain a specialized allocation-free matching path.
Sourcepub fn with_globs<I, S>(self, name: impl Into<String>, patterns: I) -> Self
pub fn with_globs<I, S>(self, name: impl Into<String>, patterns: I) -> Self
Adds or replaces a named group of arbitrary glob patterns.
Patterns containing / match normalized repository-relative paths.
Other patterns match only the native file name. Matching is
case-sensitive; callers can include explicit variants when needed.
Sourcepub fn with_composed_type<I, S>(
self,
name: impl Into<String>,
components: I,
) -> Self
pub fn with_composed_type<I, S>( self, name: impl Into<String>, components: I, ) -> Self
Adds or replaces a type composed from existing definitions.
Unknown component names contribute no patterns.
Sourcepub fn select<I, S>(self, names: I) -> Self
pub fn select<I, S>(self, names: I) -> Self
Replaces current selections with included named groups.
Unknown names simply match no files.
Sourcepub fn negate<I, S>(self, names: I) -> Self
pub fn negate<I, S>(self, names: I) -> Self
Appends excluded named groups. Later matching selections win.
pub fn is_active(&self) -> bool
pub fn contains(&self, name: &str) -> bool
Sourcepub fn names(&self) -> impl ExactSizeIterator<Item = &str> + DoubleEndedIterator
pub fn names(&self) -> impl ExactSizeIterator<Item = &str> + DoubleEndedIterator
Iterates over definition names in deterministic lexical order.
Trait Implementations§
Source§impl Clone for NamedFileTypes
impl Clone for NamedFileTypes
Source§fn clone(&self) -> NamedFileTypes
fn clone(&self) -> NamedFileTypes
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more