Enum gitoxide_core::pack::receive::Ref
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,
object: ObjectId,
},
Unborn {
full_ref_name: BString,
target: BString,
},
}
Available on crate features
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
Fields
A ref pointing to a tag
object, which in turns points to an object
, usually a commit
Direct
Fields
A ref pointing to a commit object
Symbolic
Fields
A symbolic ref pointing to target
ref, which in turn points to an object
Unborn
Fields
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§
§impl Ref
impl Ref
pub 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§
§impl<'de> Deserialize<'de> for Ref
impl<'de> Deserialize<'de> for Ref
§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>,
Deserialize this value from the given Serde deserializer. Read more
§impl Ord for Ref
impl Ord for Ref
§impl PartialOrd<Ref> for Ref
impl PartialOrd<Ref> for Ref
§fn partial_cmp(&self, other: &Ref) -> Option<Ordering>
fn partial_cmp(&self, other: &Ref) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more§impl Serialize for Ref
impl Serialize for Ref
§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,
Serialize this value into the given Serde serializer. Read more
impl Eq for Ref
impl StructuralEq for Ref
impl StructuralPartialEq for Ref
Auto Trait Implementations§
impl RefUnwindSafe for Ref
impl Send for Ref
impl Sync for Ref
impl Unpin for Ref
impl UnwindSafe for Ref
Blanket Implementations§
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more