pathlib 0.0.0

A simple path library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::PurePath;

/// A path trait.
pub trait Path: PurePath {
    /// Returns whether the path exists.
    fn exists(&self) -> bool;
    /// Returns whether the path is a directory.
    fn is_dir(&self) -> bool;
    /// Returns whether the path is a file.
    fn is_file(&self) -> bool;
    /// Returns the directory entries.
    fn read_dir(&self) -> Vec<Self>;
    /// Reads the file.
    fn read_file(&self) -> Vec<u8>;
    /// Writes the file.
    fn write_file(&self, data: &[u8]);
}