pub enum Ref {
Peeled {
full_ref_name: BString,
tag: ObjectId,
object: ObjectId,
},
Direct {
full_ref_name: BString,
object: ObjectId,
},
Symbolic {
full_ref_name: BString,
target: BString,
tag: Option<ObjectId>,
object: ObjectId,
},
Unborn {
full_ref_name: BString,
target: BString,
},
}async-client or blocking-client only.Expand description
A git reference, commonly referred to as ‘ref’, as returned by a git server before sending a pack.
Variants§
Peeled
A ref pointing to a tag object, which in turns points to an object, usually a commit
Fields
Direct
A ref pointing to a commit object
Fields
Symbolic
A symbolic ref pointing to target ref, which in turn, ultimately after possibly following tag, points to an object
Fields
target: BStringThe path of the ref the symbolic ref points to, like refs/heads/main.
See issue #205 for details
Unborn
A ref is unborn on the remote and just points to the initial, unborn branch, as is the case in a newly initialized repository or dangling symbolic refs.
Implementations§
Source§impl Ref
impl Ref
Sourcepub fn unpack(&self) -> (&BStr, Option<&oid>, Option<&oid>)
pub fn unpack(&self) -> (&BStr, Option<&oid>, Option<&oid>)
Provide shared fields referring to the ref itself, namely (name, target, [peeled]).
In case of peeled refs, the tag object itself is returned as it is what the ref directly refers to, and target of the tag is returned
as peeled.
If unborn, the first object id will be the null oid.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Ref
impl<'de> Deserialize<'de> for Ref
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Ref, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Ref, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Ord for Ref
impl Ord for Ref
Source§impl PartialOrd for Ref
impl PartialOrd for Ref
Source§impl Serialize for Ref
impl Serialize for Ref
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for Ref
impl StructuralPartialEq for Ref
Auto Trait Implementations§
impl Freeze for Ref
impl RefUnwindSafe for Ref
impl Send for Ref
impl Sync for Ref
impl Unpin for Ref
impl UnwindSafe for Ref
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
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more