pub enum RepoIdentity {
Remote(String),
Local(String),
Named(String),
}Expand description
Normalized identity of a logical project.
Variants§
Remote(String)
Derived from an upstream git remote, e.g. github.com/org/repo.
Local(String)
Fallback: an absolute local path, rendered as local:/abs/path.
Named(String)
An explicit, user-provided name.
Implementations§
Source§impl RepoIdentity
impl RepoIdentity
Sourcepub fn from_remote_url(url: &str) -> Option<RepoIdentity>
pub fn from_remote_url(url: &str) -> Option<RepoIdentity>
Build an identity from a git remote URL, normalizing the common
transports to host/path form. Returns None if no host/path can be
recovered (callers fall back to RepoIdentity::Local).
git@github.com:org/repo.git -> github.com/org/repo
https://github.com/org/repo.git -> github.com/org/repo
ssh://git@github.com/org/repo -> github.com/org/repoSourcepub fn local(path: &str) -> RepoIdentity
pub fn local(path: &str) -> RepoIdentity
Build a local: identity from an absolute path.
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 (const: unstable) · 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 Display for RepoIdentity
impl Display for RepoIdentity
impl Eq for RepoIdentity
Source§impl Hash for RepoIdentity
impl Hash for RepoIdentity
Source§impl PartialEq for RepoIdentity
impl PartialEq for RepoIdentity
Source§fn eq(&self, other: &RepoIdentity) -> bool
fn eq(&self, other: &RepoIdentity) -> bool
Tests for
self and other values to be equal, and is used by ==.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