catalog: introduce is_symlink() to check if DirEntry is a symlink.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
This commit is contained in:
Christian Ebner 2020-02-27 17:12:56 +01:00 committed by Dietmar Maurer
parent 11ee5c0563
commit c2f9149461

View File

@ -112,6 +112,14 @@ impl DirEntry {
_ => false, _ => false,
} }
} }
/// Check if DirEntry is a symlink
pub fn is_symlink(&self) -> bool {
match self.attr {
DirEntryAttribute::Symlink { .. } => true,
_ => false,
}
}
} }
struct DirInfo { struct DirInfo {