pub enum TargetRef<'a> {
Peeled(&'a oid),
Symbolic(&'a FullNameRef),
}
Expand description
Denotes a ref target, equivalent to Kind
, but with immutable data.
Variants§
Peeled(&'a oid)
A ref that points to an object id
Symbolic(&'a FullNameRef)
A ref that points to another reference by its validated name, adding a level of indirection.
Implementations§
source§impl<'a> TargetRef<'a>
impl<'a> TargetRef<'a>
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_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.
sourcepub fn into_owned(self) -> Target
pub fn into_owned(self) -> Target
Convert this instance into an owned version, without consuming it.
Trait Implementations§
source§impl<'a> Ord for TargetRef<'a>
impl<'a> Ord for TargetRef<'a>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<'a> PartialEq<TargetRef<'a>> for Target
impl<'a> PartialEq<TargetRef<'a>> for Target
source§impl<'a> PartialEq<TargetRef<'a>> for TargetRef<'a>
impl<'a> PartialEq<TargetRef<'a>> for TargetRef<'a>
source§impl<'a> PartialOrd<TargetRef<'a>> for TargetRef<'a>
impl<'a> PartialOrd<TargetRef<'a>> for TargetRef<'a>
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