pub enum Target {
Peeled(ObjectId),
Symbolic(FullName),
}
Expand description
Denotes a ref target, equivalent to Kind
, but with mutable data.
Variants§
Peeled(ObjectId)
A ref that points to an object id
Symbolic(FullName)
A ref that points to another reference by its validated name, adding a level of indirection.
Note that this is an extension of gitoxide which will be helpful in logging all reference changes.
Implementations§
source§impl Target
impl Target
sourcepub fn try_id(&self) -> Option<&oid>
pub fn try_id(&self) -> Option<&oid>
Interpret this target as object id which maybe None
if it is symbolic.
sourcepub fn try_into_id(self) -> Result<ObjectId, Self>
pub fn try_into_id(self) -> Result<ObjectId, Self>
Return the contained object id if the target is peeled or itself if it is not.
sourcepub fn try_name(&self) -> Option<&FullNameRef>
pub fn try_name(&self) -> Option<&FullNameRef>
Interpret this target as name of the reference it points to which maybe None
if it an object id.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Target
impl<'de> Deserialize<'de> for Target
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for Target
impl Ord for Target
source§impl PartialEq<Target> for Target
impl PartialEq<Target> for Target
source§impl<'a> PartialEq<TargetRef<'a>> for Target
impl<'a> PartialEq<TargetRef<'a>> for Target
source§impl PartialOrd<Target> for Target
impl PartialOrd<Target> for Target
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