pub struct GithubPath {
pub owner: String,
pub repo: String,
}Expand description
A parsed, slugified GitHub-style project identity.
Why: #1220’s workspace-root convention nests sessions under
~/trusty-mpm-projects/<owner>/<repo>/, so callers need the owner and the
repo as two independent, filesystem-safe segments — not a single fused token.
Keeping them in a struct (rather than a tuple) makes call sites self-documenting
and lets the type grow (e.g. a host field) without breaking signatures.
What: the slugified owner and repo path segments. Both are guaranteed
non-empty by every constructor in this module (a parse that cannot produce a
non-empty repo returns None); owner is "unknown-owner" only via the
explicit owner-less fallback documented on parse_github_path.
Test: every parse_* test asserts the two fields independently.
Fields§
§owner: StringSlugified repository owner (GitHub user or org), e.g. bobmatnyc.
repo: StringSlugified repository name, e.g. trusty-tools.
Implementations§
Source§impl GithubPath
impl GithubPath
Sourcepub fn rel_path(&self) -> String
pub fn rel_path(&self) -> String
Render the identity as the relative path <owner>/<repo>.
Why: the workspace-root builder joins this onto the configured root; a
single accessor keeps the join order (owner then repo) in one place so
callers cannot accidentally swap the segments.
What: returns format!("{owner}/{repo}") — always using / so the result
is a portable relative path that Path::join splits into two components.
Test: github_path_rel_joins_owner_repo.
Trait Implementations§
Source§impl Clone for GithubPath
impl Clone for GithubPath
Source§fn clone(&self) -> GithubPath
fn clone(&self) -> GithubPath
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GithubPath
impl Debug for GithubPath
impl Eq for GithubPath
Source§impl PartialEq for GithubPath
impl PartialEq for GithubPath
Source§fn eq(&self, other: &GithubPath) -> bool
fn eq(&self, other: &GithubPath) -> bool
self and other values to be equal, and is used by ==.