Trait path_abs::PathInfo [−][src]
Methods that return information about a path.
This trait provides the familiar methods from std::path::Path
for the Path*
types. These methods take the same parameters and return
the same types as the originals in the standard library, except where
noted.
As a general rule, methods that can return an error will return a rich
path_abs::Error
instead of a std::io::Error
(although it will
automatically convert into a std::io::Error
with ?
if needed).
Required methods
Loading content...Provided methods
fn as_os_str(&self) -> &OsStr
[src]
fn to_str(&self) -> Option<&str>
[src]
fn to_string_lossy(&self) -> Cow<'_, str>
[src]
fn is_absolute(&self) -> bool
[src]
fn is_relative(&self) -> bool
[src]
fn has_root(&self) -> bool
[src]
fn ancestors(&self) -> Ancestors<'_>
[src]
fn file_name(&self) -> Option<&OsStr>
[src]
fn strip_prefix<P>(&self, base: P) -> Result<&Path, StripPrefixError> where
P: AsRef<Path>,
[src]
P: AsRef<Path>,
fn starts_with<P: AsRef<Path>>(&self, base: P) -> bool
[src]
fn ends_with<P: AsRef<Path>>(&self, base: P) -> bool
[src]
fn file_stem(&self) -> Option<&OsStr>
[src]
fn extension(&self) -> Option<&OsStr>
[src]
fn components(&self) -> Components<'_>
[src]
fn iter(&self) -> Iter<'_>
[src]
fn display(&self) -> Display<'_>
[src]
fn metadata(&self) -> Result<Metadata>
[src]
Queries the file system to get information about a file, directory, etc.
The same as std::path::Path::metadata()
, except that it returns a
rich path_abs::Error
when a problem is encountered.
fn symlink_metadata(&self) -> Result<Metadata>
[src]
Queries the metadata about a file without following symlinks.
The same as std::path::Path::symlink_metadata()
, except that it
returns a rich path_abs::Error
when a problem is encountered.
fn exists(&self) -> bool
[src]
fn is_file(&self) -> bool
[src]
fn is_dir(&self) -> bool
[src]
fn read_link(&self) -> Result<PathBuf>
[src]
Reads a symbolic link, returning the path that the link points to.
The same as std::path::Path::read_link()
, except that it returns a
rich path_abs::Error
when a problem is encountered.
[`std::path::Pathdoc.rust-lang.org/stable/std/path/struct.Path.html#method.read_link
fn canonicalize(&self) -> Result<PathAbs>
[src]
Returns the canonical, absolute form of the path with all intermediate components normalized and symbolic links resolved.
The same as std::path::Path::canonicalize()
,
- On success, returns a
path_abs::PathAbs
instead of aPathBuf
- returns a rich
path_abs::Error
when a problem is encountered
fn parent(&self) -> Result<&Path>
[src]
Returns the path without its final component, if there is one.
The same as std::path::Path::parent()
, except that it returns a
Result
with a rich path_abs::Error
when a problem is encountered.