pub struct GitUrl { /* private fields */ }Expand description
A URL reference to a Git repository.
Implementations§
Source§impl GitUrl
impl GitUrl
Sourcepub fn from_reference(
repository: DisplaySafeUrl,
reference: GitReference,
) -> Result<Self, GitUrlParseError>
pub fn from_reference( repository: DisplaySafeUrl, reference: GitReference, ) -> Result<Self, GitUrlParseError>
Create a new GitUrl from a repository URL and a reference.
Sourcepub fn from_commit(
repository: DisplaySafeUrl,
reference: GitReference,
precise: GitOid,
) -> Result<Self, GitUrlParseError>
pub fn from_commit( repository: DisplaySafeUrl, reference: GitReference, precise: GitOid, ) -> Result<Self, GitUrlParseError>
Create a new GitUrl from a repository URL and a precise commit.
Sourcepub fn from_fields(
repository: DisplaySafeUrl,
reference: GitReference,
precise: Option<GitOid>,
) -> Result<Self, GitUrlParseError>
pub fn from_fields( repository: DisplaySafeUrl, reference: GitReference, precise: Option<GitOid>, ) -> Result<Self, GitUrlParseError>
Create a new GitUrl from a repository URL and a precise commit, if known.
Sourcepub fn with_precise(self, precise: GitOid) -> Self
pub fn with_precise(self, precise: GitOid) -> Self
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.
Sourcepub fn repository(&self) -> &DisplaySafeUrl
pub fn repository(&self) -> &DisplaySafeUrl
Return the [Url] of the Git repository.
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.
Trait Implementations§
Source§impl From<GitUrl> for DisplaySafeUrl
impl From<GitUrl> for DisplaySafeUrl
Source§impl Ord for GitUrl
impl Ord for GitUrl
Source§impl PartialOrd for GitUrl
impl PartialOrd for GitUrl
Source§impl TryFrom<DisplaySafeUrl> for GitUrl
impl TryFrom<DisplaySafeUrl> for GitUrl
impl Eq for GitUrl
impl StructuralPartialEq for GitUrl
Auto Trait Implementations§
impl Freeze for GitUrl
impl RefUnwindSafe for GitUrl
impl Send for GitUrl
impl Sync for GitUrl
impl Unpin 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