pub enum FilePattern {
Exact(String),
Extensions {
base: String,
extensions: Vec<String>,
},
Glob(String),
Any(Vec<Self>),
}Expand description
Pattern for matching configuration files.
Supports exact filenames, multiple extensions, and glob patterns.
Variants§
Exact(String)
Exact filename match.
Extensions
Match file with any of the specified extensions.
Fields
Glob(String)
Glob pattern match (e.g., “.conf”, “**/.toml”).
Any(Vec<Self>)
Match any of the provided patterns.
Implementations§
Source§impl FilePattern
impl FilePattern
Sourcepub fn extensions(base: impl Into<String>, exts: &[&str]) -> Self
pub fn extensions(base: impl Into<String>, exts: &[&str]) -> Self
Create a pattern that matches multiple extensions.
Sourcepub fn concrete_filenames(&self) -> Option<Vec<String>>
pub fn concrete_filenames(&self) -> Option<Vec<String>>
Returns a list of concrete filenames if this pattern represents exact files.
Returns None for glob patterns.
Sourcepub fn has_recursive_glob(&self) -> bool
pub fn has_recursive_glob(&self) -> bool
Check if this pattern contains recursive glob (**).
Trait Implementations§
Source§impl Clone for FilePattern
impl Clone for FilePattern
Source§fn clone(&self) -> FilePattern
fn clone(&self) -> FilePattern
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 FilePattern
impl Debug for FilePattern
Source§impl Default for FilePattern
impl Default for FilePattern
Source§impl PartialEq for FilePattern
impl PartialEq for FilePattern
impl Eq for FilePattern
impl StructuralPartialEq for FilePattern
Auto Trait Implementations§
impl Freeze for FilePattern
impl RefUnwindSafe for FilePattern
impl Send for FilePattern
impl Sync for FilePattern
impl Unpin for FilePattern
impl UnsafeUnpin for FilePattern
impl UnwindSafe for FilePattern
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