pub struct GitUrl { /* private fields */ }Expand description
A URL reference to a Git repository.
Implementations§
Source§impl GitUrl
impl GitUrl
Sourcepub fn from_commit(
url: SafeUrl,
reference: GitReference,
precise: GitOid,
lfs: GitLfs,
) -> Result<Self, GitUrlParseError>
pub fn from_commit( url: SafeUrl, reference: GitReference, precise: GitOid, lfs: GitLfs, ) -> Result<Self, GitUrlParseError>
Create a new GitUrl from a repository URL and a precise commit.
Sourcepub fn from_fields(
url: SafeUrl,
reference: GitReference,
precise: Option<GitOid>,
lfs: GitLfs,
) -> Result<Self, GitUrlParseError>
pub fn from_fields( url: SafeUrl, reference: GitReference, precise: Option<GitOid>, lfs: GitLfs, ) -> Result<Self, GitUrlParseError>
Create a new GitUrl from a repository URL and a precise commit, if known.
Sourcepub fn with_precise(self, precise: GitOid) -> Result<Self, GitUrlParseError>
pub fn with_precise(self, precise: GitOid) -> Result<Self, GitUrlParseError>
Set the precise GitOid to use for this Git URL.
Sourcepub fn with_reference(self, reference: GitReference) -> Self
pub fn with_reference(self, reference: GitReference) -> Self
Set the GitReference to use for this Git URL, clearing any resolved commit if it changes.
Sourcepub fn repository(&self) -> &RepositoryUrl
pub fn repository(&self) -> &RepositoryUrl
Return the canonical repository identity for this Git URL.
Sourcepub fn reference(&self) -> &GitReference
pub fn reference(&self) -> &GitReference
Return the reference to the commit to use, which could be a branch, tag or revision.
Sourcepub fn precise(&self) -> Option<GitOid>
pub fn precise(&self) -> Option<GitOid>
Return the precise commit, whether requested directly or resolved from a named reference.
Sourcepub fn resolved_commit(&self) -> Option<GitOid>
pub fn resolved_commit(&self) -> Option<GitOid>
Return the commit obtained by resolving a reference, if known.
Returns None when the reference is itself a full commit.
Trait Implementations§
impl Eq for GitUrl
Source§impl Ord for GitUrl
impl Ord for GitUrl
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Auto Trait Implementations§
impl Freeze for GitUrl
impl RefUnwindSafe for GitUrl
impl Send for GitUrl
impl Sync for GitUrl
impl Unpin for GitUrl
impl UnsafeUnpin for GitUrl
impl UnwindSafe for GitUrl
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