[][src]Struct dia_files::path_filter::All

pub struct All { /* fields omitted */ }

A filter that combines all filters you provide, using logical conjunction

Notes

  • If you provide an empty list, this filter rejects all paths.
  • Files are only accepted if all filters accept them.

Examples

To find all Rust source files, ignoring vesion control systems' and build directories:

use std::path::PathBuf;
use dia_files::path_filter::{All, Filter, IgnoredDirNames, SomeFileExts};

const IGNORED_DIR_NAMES: &[&str] = &[
    ".git", ".hg", ".svn", ".gradle", "target", "build", "release", "debug",
];
const FILE_EXTS: &[&str] = &["rs"];

let dir = PathBuf::from(file!()).parent().unwrap().to_path_buf();
let filters: Vec<Box<Filter>> = vec![
    Box::new(IgnoredDirNames::new(IGNORED_DIR_NAMES)),
    Box::new(SomeFileExts::new(FILE_EXTS)),
];
let filter = All::new(filters);
assert!(dia_files::find_files(dir, false, filter).unwrap().count() > 0);

Methods

impl All[src]

pub fn new(filters: Vec<Box<dyn Filter>>) -> Self[src]

Trait Implementations

impl Filter for All[src]

Auto Trait Implementations

impl !Send for All

impl !Sync for All

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]