pub enum Source {
ObjectId(ObjectId),
Ref(Ref),
}
Available on crate feature
fetch
only.Expand description
Either an object id that the remote has or the matched remote ref itself.
Variants§
ObjectId(ObjectId)
An object id, as the matched ref-spec was an object id itself.
Ref(Ref)
The remote reference that matched the ref-specs name.
Implementations§
Source§impl Source
impl Source
Sourcepub fn as_id(&self) -> Option<&oid>
pub fn as_id(&self) -> Option<&oid>
Return either the direct object id we refer to or the direct target that a reference refers to.
The latter may be a direct or a symbolic reference.
If unborn, None
is returned.
Sourcepub fn as_target(&self) -> Option<&BStr>
pub fn as_target(&self) -> Option<&BStr>
Return the target that this symbolic ref is pointing to, or None
if it is no symbolic ref.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Source
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnwindSafe for Source
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