Function fs_extra::dir::get_details_entry [−][src]
pub fn get_details_entry<P>(
path: P,
config: &HashSet<DirEntryAttr>
) -> Result<HashMap<DirEntryAttr, DirEntryValue>> where
P: AsRef<Path>,
Returned information about directory entry with information which you choose in config.
This function takes to arguments:
-
path
- Path to directory. -
config
- Set attributes which you want see inside return data.
Errors
This function will return an error in the following situations, but is not limited to just these cases:
- This
path
does not exist. - Invalid
path
. - The current process does not have the permission rights to access
path
.
#Examples
ⓘ
extern crate fs_extra; use fs_extra::dir::{get_details_entry, DirEntryAttr}; use std::collections::{HashMap, HashSet}; let mut config = HashSet::new(); config.insert(DirEntryAttr::Name); config.insert(DirEntryAttr::Size); let entry_info = get_details_entry("test", &config); assert_eq!(2, entry_info.len());