pub struct DirEntry<'n> {
pub name: &'n [u8],
pub is_dir: bool,
pub size: u64,
pub mtime: u32,
pub sealed: bool,
}Expand description
One entry from Fs::list_dir.
name is BYTES, not &str, and that is not laziness. services/fs accepts any byte above
0x1f except / and 0x7f in a name, so a name is not guaranteed to be UTF-8 and a type that
promised otherwise would be lying about the filesystem it reads. DirEntry::name_str is the
convenience for the ordinary case.
Fields§
§name: &'n [u8]The entry’s name within its directory. Never contains a /.
is_dir: booltrue if this entry is itself a directory.
size: u64Size in bytes. Zero for a directory.
mtime: u32Last-modified time as services/fs records it.
sealed: booltrue if the file is sealed (append-only; writes to it are refused).
Implementations§
Trait Implementations§
Source§impl<'n> PartialEq for DirEntry<'n>
impl<'n> PartialEq for DirEntry<'n>
impl<'n> Copy for DirEntry<'n>
impl<'n> Eq for DirEntry<'n>
impl<'n> StructuralPartialEq for DirEntry<'n>
Auto Trait Implementations§
impl<'n> Freeze for DirEntry<'n>
impl<'n> RefUnwindSafe for DirEntry<'n>
impl<'n> Send for DirEntry<'n>
impl<'n> Sync for DirEntry<'n>
impl<'n> Unpin for DirEntry<'n>
impl<'n> UnsafeUnpin for DirEntry<'n>
impl<'n> UnwindSafe for DirEntry<'n>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more