Trait vfs::VPath
[−]
[src]
pub trait VPath: Debug + Send + Sync { fn open_with_options(&self, openOptions: &OpenOptions) -> Result<Box<VFile>>; fn mkdir(&self) -> Result<()>; fn file_name(&self) -> Option<String>; fn extension(&self) -> Option<String>; fn resolve(&self, path: &String) -> Box<VPath>; fn parent(&self) -> Option<Box<VPath>>; fn exists(&self) -> bool; fn metadata(&self) -> Result<Box<VMetadata>>; fn read_dir(&self) -> Result<Box<Iterator<Item=Result<Box<VPath>>>>>; fn to_string(&self) -> Cow<str>; fn box_clone(&self) -> Box<VPath>; fn open(&self) -> Result<Box<VFile>> { ... } fn create(&self) -> Result<Box<VFile>> { ... } fn append(&self) -> Result<Box<VFile>> { ... } }
A abstract path to a location in a filesystem
Required Methods
fn open_with_options(&self, openOptions: &OpenOptions) -> Result<Box<VFile>>
Open the file at this path with the given options
fn mkdir(&self) -> Result<()>
Create a directory at the location by this path
fn file_name(&self) -> Option<String>
The file name of this path
fn extension(&self) -> Option<String>
The extension of this filename
fn resolve(&self, path: &String) -> Box<VPath>
append a segment to this path
fn parent(&self) -> Option<Box<VPath>>
Get the parent path
fn exists(&self) -> bool
Check if the file existst
fn metadata(&self) -> Result<Box<VMetadata>>
Get the file's metadata
fn read_dir(&self) -> Result<Box<Iterator<Item=Result<Box<VPath>>>>>
Retrieve the path entries in this path
fn to_string(&self) -> Cow<str>
Retrieve a string representation
fn box_clone(&self) -> Box<VPath>
Provided Methods
fn open(&self) -> Result<Box<VFile>>
Open the file at this path for reading
fn create(&self) -> Result<Box<VFile>>
Open the file at this path for writing, truncating it if it exists already
fn append(&self) -> Result<Box<VFile>>
Open the file at this path for appending, creating it if necessary
Implementors
impl VPath for PathBuf
impl VPath for MemoryPath