use fuser::FileType;
#[derive(Debug, Clone)]
pub struct FuseDirEntry {
pub name: String,
pub ino: u64,
pub kind: FileType,
}
impl FuseDirEntry {
#[must_use]
pub fn new(name: impl Into<String>, ino: u64, kind: FileType) -> Self {
Self {
name: name.into(),
ino,
kind,
}
}
#[must_use]
pub fn file(name: impl Into<String>, ino: u64) -> Self {
Self::new(name, ino, FileType::RegularFile)
}
#[must_use]
pub fn directory(name: impl Into<String>, ino: u64) -> Self {
Self::new(name, ino, FileType::Directory)
}
#[must_use]
pub fn symlink(name: impl Into<String>, ino: u64) -> Self {
Self::new(name, ino, FileType::Symlink)
}
}