[−][src]Struct dia_files::filter::SomeFileExts
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]
Trait Implementations
impl<'_> Filter for SomeFileExts<'_>
[src]
impl<'a> Clone for SomeFileExts<'a>
[src]
fn clone(&self) -> 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]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,