[−][src]Struct filetools::filehelpers::FileHelpers
Methods
impl FileHelpers
[src]
pub fn ensure_dir(dir_name: PathBuf) -> Result<()>
[src]
Ensures a directory is created from a PathBuf
Does nothing if the directory already exists
Returns Ok
if successful, Err
if not
pub fn is_subdir(path: PathBuf, directory: PathBuf) -> Result<bool>
[src]
Determines if a path
if a subdirectory of the given directory
Creates the absolute paths and checks the ancestors
of path
to determine if a subdirectory
Note::Not entirely sure this works perfectly fine, use at own risk
Returns Ok(true)
if path
is a subdirectory, Ok(false)
if not, Err
if error occured
pub fn path_contains(path: PathBuf, search_str: &str) -> bool
[src]
Determines if a given PathBuf
contains a search string
Returns true
if search string present, else false
pub fn list_files(path: PathBuf, recursive: bool) -> Result<Vec<PathBuf>>
[src]
Lists all files in a given path
If recursive
is set, iterates through all subfolders recursively to find all files
If recursive
not set, just finds all files in the current directory
Return Vec<PathBuf>
of all files in a directory and subdirectories
pub fn list_folders(path: PathBuf, recursive: bool) -> Result<Vec<PathBuf>>
[src]
Lists all folders in a given path
If recursive
is set, iterates through all subfolders recursively to find all folders
If recursive
not set, just finds all files in the current directory
Mirrors the functionality of FileHelpers::list_files()
Return Vec<PathBuf>
of all folders in a directory and subdirectories
Auto Trait Implementations
impl RefUnwindSafe for FileHelpers
impl Send for FileHelpers
impl Sync for FileHelpers
impl Unpin for FileHelpers
impl UnwindSafe for FileHelpers
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,