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<'a> PartialEq<TargetRef<'a>> for Target
impl<'a> PartialEq<TargetRef<'a>> for Target
source§impl PartialEq for Target
impl PartialEq for Target
source§impl PartialOrd for Target
impl PartialOrd 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 moreimpl Eq for Target
impl StructuralPartialEq for Target
Auto Trait Implementations§
impl Freeze for Target
impl RefUnwindSafe for Target
impl Send for Target
impl Sync for Target
impl Unpin for Target
impl UnwindSafe for Target
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)