[go: up one dir, main page]

Module path

Source
Expand description

Modules§

env
Information about the environment in terms of locations of resources.
realpath
relative_path

Structs§

RelativePath
A wrapper for BStr. It is used to enforce the following constraints:
Utf8Error
The error type returned by into_bstr() and others may suffer from failed conversions from or to bytes.

Functions§

from_bstr
Similar to try_from_bstr(), but panics if malformed surrogates are encountered on Windows.
from_bstring
Similar to try_from_bstring(), but will panic if there is ill-formed UTF-8 in the input.
from_byte_slice
Similar to try_from_byte_slice(), but will panic if there is ill-formed UTF-8 in the input.
into_bstr
Similar to try_into_bstr() but panics if malformed surrogates are encountered on Windows.
is_absolute
return true if path is absolute, which depends on the platform but is always true if it starts with a slash, hence looks like a linux path.
join_bstr_unix_pathsep
Join path to base such that they are separated with a /, i.e. base/path.
normalize
Resolve relative components virtually, eliminating intermediate .. without accessing the filesystem.
os_str_into_bstr
Like into_bstr(), but takes OsStr as input for a lossless, but fallible, conversion.
os_string_into_bstring
Like into_bstr(), but takes OsString as input for a lossless, but fallible, conversion.
realpath
Check each component of path and see if it is a symlink. If so, resolve it. Do not fail for non-existing components, but assume these are as is.
realpath_opts
The same as realpath(), but allow to configure max_symlinks to configure how many symbolic links we are going to follow. This serves to avoid running into cycles or doing unreasonable amounts of work.
relativize_with_prefix
Rebuild the worktree-relative relative_path to be relative to prefix, which is the worktree-relative path equivalent to the position of the user, or current working directory.
to_native_path_on_windows
Convert paths with slashes to backslashes on Windows and do nothing on Unix, but panic if unpaired surrogates are encountered on Windows.
to_native_separators
Assures the given bytes use the native path separator.
to_unix_separators
Replace Windows path separators with slashes, which typically resembles a Unix path, unconditionally.
to_unix_separators_on_windows
Replace Windows path separators with slashes, but only do so on Windows.
to_windows_separators
Find slashes and replace them with backslashes, unconditionally.
try_from_bstr
Similar to from_byte_slice(), but takes either borrowed or owned input.
try_from_bstring
Similar to try_from_bstr(), but takes and produces owned data.
try_from_byte_slice
Given input bytes, produce a Path from them ignoring encoding entirely if on Unix.
try_into_bstr
Convert the given path either into its raw bytes on Unix or its UTF-8 encoded counterpart on Windows.
try_os_str_into_bstr
Like into_bstr(), but takes Cow<OsStr> as input for a lossless, but fallible, conversion.