pub enum Target {
Object(ObjectId),
Symbolic(FullName),
}
Expand description
Denotes a ref target, equivalent to Kind
, but with mutable data.
Variants§
Object(ObjectId)
A ref that points directly 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 PartialOrd for Target
impl PartialOrd for Target
impl 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