pub enum FtFilter {
Raw(String),
Path(PathBuf),
Regex(Regex),
}
Expand description
Filter types for listing files / directories
§Example
use filetools::FtFilter;
use std::path::PathBuf;
use regex::Regex;
// Use a raw String filter to match an item containing ".log"
let filter = FtFilter::Raw(".log".to_string());
// Use the Path filter to match paths that contain `sub/path/to/math`
let filter = FtFilter::Path(PathBuf::from("sub/path/to/match"));
// Use a Regex filter to match all files ending with `.rs`
let re = Regex::new(r"(.*)\.rs").expect("unable to create regex");
let filter = FtFilter::Regex(re);
Variants§
Raw(String)
Filter based on a raw String pattern
Path(PathBuf)
Filter based on a PathBuf pattern
Regex(Regex)
Filter based on a regex pattern
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FtFilter
impl RefUnwindSafe for FtFilter
impl Send for FtFilter
impl Sync for FtFilter
impl Unpin for FtFilter
impl UnwindSafe for FtFilter
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