pub struct RepoIdentity {
pub host: String,
pub org_path: String,
pub repo: String,
}Expand description
Canonical repository identity extracted from a git URL.
This struct normalizes various URL formats (SSH, HTTPS, with/without .git suffix) into a consistent identity that can be used for deduplication and matching.
Fields§
§host: StringHost name (lowercased), e.g., “github.com”
org_path: StringOrganization path (may contain multiple segments for GitLab subgroups), e.g., “org” or “group/subgroup”
repo: StringRepository name (no .git suffix, no trailing slash)
Implementations§
Source§impl RepoIdentity
impl RepoIdentity
Sourcepub fn parse(url: &str) -> Result<Self>
pub fn parse(url: &str) -> Result<Self>
Parse a git URL into a RepoIdentity.
Supported formats:
- SSH scp-like:
git@github.com:org/repo.git - SSH with port:
ssh://git@host:2222/org/repo.git - HTTPS:
https://github.com/org/repoorhttps://github.com/org/repo.git - GitLab subgroups:
https://gitlab.com/a/b/c/repo.git - Azure DevOps:
https://dev.azure.com/org/proj/_git/repo
§Errors
Returns an error if the URL cannot be parsed or has invalid structure.
Sourcepub fn canonical_key(&self) -> RepoIdentityKey
pub fn canonical_key(&self) -> RepoIdentityKey
Get the canonical key for identity-based lookups.
All fields are lowercased for case-insensitive matching.
Trait Implementations§
Source§impl Clone for RepoIdentity
impl Clone for RepoIdentity
Source§fn clone(&self) -> RepoIdentity
fn clone(&self) -> RepoIdentity
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RepoIdentity
impl Debug for RepoIdentity
Source§impl PartialEq for RepoIdentity
impl PartialEq for RepoIdentity
impl Eq for RepoIdentity
impl StructuralPartialEq for RepoIdentity
Auto Trait Implementations§
impl Freeze for RepoIdentity
impl RefUnwindSafe for RepoIdentity
impl Send for RepoIdentity
impl Sync for RepoIdentity
impl Unpin for RepoIdentity
impl UnsafeUnpin for RepoIdentity
impl UnwindSafe for RepoIdentity
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.