pub enum DirOrFile {
Dir(PathBuf),
File(PathBuf),
}
Expand description
Specifies whether an input path is a directory or a file (since this distinction can’t be made from the filename alone)
Variants§
Implementations§
source§impl DirOrFile
impl DirOrFile
sourcepub fn get_path_buf(&self) -> &PathBuf
pub fn get_path_buf(&self) -> &PathBuf
Returns the PathBuf
of the DirOrFile
sourcepub fn components(&self) -> Vec<String>
pub fn components(&self) -> Vec<String>
Returns all the “Normal” components of the PathBuf, note that non-normal (such as “.”, symlinks, etc. components) are ignored
Trait Implementations§
source§impl Ord for DirOrFile
impl Ord for DirOrFile
source§impl PartialEq<DirOrFile> for DirOrFile
impl PartialEq<DirOrFile> for DirOrFile
source§impl PartialOrd<DirOrFile> for DirOrFile
impl PartialOrd<DirOrFile> for DirOrFile
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for DirOrFile
impl StructuralEq for DirOrFile
impl StructuralPartialEq for DirOrFile
Auto Trait Implementations§
impl RefUnwindSafe for DirOrFile
impl Send for DirOrFile
impl Sync for DirOrFile
impl Unpin for DirOrFile
impl UnwindSafe for DirOrFile
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.