use crate::filesystem::primitives::{DirEntryInner, Metadata};
#[cfg(not(windows))]
use rustix::fs::DirEntryExt;
use std::ffi::OsString;
use std::{fmt, io};
pub struct DirEntry {
pub(crate) inner: DirEntryInner,
}
impl DirEntry {
#[inline]
pub fn metadata(&self) -> io::Result<Metadata> {
self.inner.metadata()
}
#[inline]
pub fn file_name(&self) -> OsString {
self.inner.file_name()
}
}
#[cfg(not(windows))]
impl DirEntryExt for DirEntry {
#[inline]
fn ino(&self) -> u64 {
self.inner.ino()
}
}
impl fmt::Debug for DirEntry {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
self.inner.fmt(f)
}
}