Struct jujutsu_lib::repo_path::RepoPath
source · 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<RepoPath> for RepoPath
impl PartialOrd<RepoPath> for RepoPath
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read more