pub struct RepoPath { /* private fields */ }
Implementations§
Source§impl RepoPath
impl RepoPath
pub fn root() -> Self
pub fn from_internal_string(value: &str) -> Self
pub fn from_components(components: Vec<RepoPathComponent>) -> Self
Sourcepub fn parse_fs_path(
cwd: &Path,
base: &Path,
input: &str,
) -> Result<Self, FsPathParseError>
pub fn parse_fs_path( cwd: &Path, base: &Path, input: &str, ) -> Result<Self, FsPathParseError>
Parses an input
path into a RepoPath
relative to base
.
The cwd
and base
paths are supposed to be absolute and normalized in
the same manner. The input
path may be either relative to cwd
or
absolute.
Sourcepub fn to_internal_dir_string(&self) -> String
pub fn to_internal_dir_string(&self) -> String
The full string form used internally, not for presenting to users (where we may want to use the platform’s separator). This format includes a trailing slash, unless this path represents the root directory. That way it can be concatenated with a basename and produce a valid path.
Sourcepub fn to_internal_file_string(&self) -> String
pub fn to_internal_file_string(&self) -> String
The full string form used internally, not for presenting to users (where we may want to use the platform’s separator).
pub fn to_fs_path(&self, base: &Path) -> PathBuf
pub fn is_root(&self) -> bool
pub fn contains(&self, other: &RepoPath) -> bool
pub fn parent(&self) -> Option<RepoPath>
pub fn split(&self) -> Option<(RepoPath, &RepoPathComponent)>
pub fn components(&self) -> &Vec<RepoPathComponent>
Trait Implementations§
Source§impl Ord for RepoPath
impl Ord for RepoPath
Source§impl PartialOrd for RepoPath
impl PartialOrd for RepoPath
Source§impl RepoPathJoin<RepoPathComponent> for RepoPath
impl RepoPathJoin<RepoPathComponent> for RepoPath
impl Eq for RepoPath
impl StructuralPartialEq for RepoPath
Auto Trait Implementations§
impl Freeze for RepoPath
impl RefUnwindSafe for RepoPath
impl Send for RepoPath
impl Sync for RepoPath
impl Unpin for RepoPath
impl UnwindSafe for RepoPath
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more