Struct rofl::FileLoader
[−]
[src]
pub struct FileLoader<'pl> { /* fields omitted */ }
Loader for files in given directory.
The resources it doles out are just file handles (std::fs::File
).
Wrappers around this loaded can then implement their own decoding.
Methods
impl<'pl> FileLoader<'pl>
[src]
fn new<D: AsRef<Path>>(directory: D) -> Self
Create loader for files within given directory.
fn for_extension<D: AsRef<Path>, S>(directory: D, extension: S) -> Self where
S: ToString,
S: ToString,
Create loader for files within given directory that have the specified file extension.
fn for_extensions<D: AsRef<Path>, I, S>(directory: D, extensions: I) -> Self where
I: IntoIterator<Item = S>,
S: ToString,
I: IntoIterator<Item = S>,
S: ToString,
Create a loader which only loads files from the specified directory that have one of the extensions given.
fn with_path_predicate<D, P>(directory: D, predicate: P) -> Self where
D: AsRef<Path>,
P: Fn(&Path) -> bool + Send + Sync + 'pl,
D: AsRef<Path>,
P: Fn(&Path) -> bool + Send + Sync + 'pl,
Create a loader which only loads files from the specified directory that additionally match a specified boolean predicate for their paths.