[][src]Struct dia_files::filter::SomeFileExts

pub struct SomeFileExts<'a> { /* fields omitted */ }

A filter that only accepts files by extensions you provide

Notes

  • File extensions do not contain leading dot ..
  • Providing an empty list means you have nothing to pick. So all files will be ignored.
  • To pick files which have no extensions, you can provide NO_EXT.

Examples

use std::path::PathBuf;
use dia_files::filter::{NO_EXT, Case, SomeFileExts};

let dir = PathBuf::from(file!()).parent().unwrap().to_path_buf();

let filter = SomeFileExts::new(&["rs"], Case::Sensitive);
assert!(dia_files::find_files(&dir, false, filter).unwrap().count() > 0);

let filter = SomeFileExts::new(&[], Case::Insensitive);
assert!(dia_files::find_files(&dir, false, filter).unwrap().count() == 0);

let filter = SomeFileExts::new(&[NO_EXT], Case::Insensitive);
assert!(dia_files::find_files(&dir, false, filter).unwrap().count() == 0);

Methods

impl<'a> SomeFileExts<'a>[src]

pub fn new(file_exts: &'a [&'a str], case: Case) -> Self[src]

Trait Implementations

impl<'_> Filter for SomeFileExts<'_>[src]

impl<'a> Clone for SomeFileExts<'a>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'a> Debug for SomeFileExts<'a>[src]

Auto Trait Implementations

impl<'a> Send for SomeFileExts<'a>

impl<'a> Sync for SomeFileExts<'a>

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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]