pub enum Data<'a> {
File(File<'a>),
Dir(Dir<'a>),
Symlink(PathBuf),
BlockDev(u32, u32),
CharDev(u32, u32),
Fifo,
Socket,
}
Expand description
Enum type for the various kinds of data that an inode can be.
This is retrieved by calling Node::data
and can be matched to determine the type and
contents of a node.
For accessing files and directories, Node
provides the as_dir
and
as_file
methods to bypass Data
completely.
Variants§
File(File<'a>)
A regular file, containing a File
object that can be used to extract the file contents.
Dir(Dir<'a>)
A directory, containing a Dir
that can be used to access the directory’s children.
Symlink(PathBuf)
A symbolic link, containing the target of the link as a PathBuf
.
BlockDev(u32, u32)
A block device file, containing the device’s major and minor numbers.
CharDev(u32, u32)
A character device file, containing the device’s major and minor numbers.
Fifo
A named pipe.
Socket
A socket.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a> !Freeze for Data<'a>
impl<'a> RefUnwindSafe for Data<'a>
impl<'a> !Send for Data<'a>
impl<'a> !Sync for Data<'a>
impl<'a> Unpin for Data<'a>
impl<'a> UnwindSafe for Data<'a>
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