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
sourceimpl<'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<&BStr>
pub fn try_name(&self) -> Option<&BStr>
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
sourceimpl<'a> Ord for TargetRef<'a>
impl<'a> Ord for TargetRef<'a>
sourceimpl<'a> PartialOrd<TargetRef<'a>> for TargetRef<'a>
impl<'a> PartialOrd<TargetRef<'a>> for TargetRef<'a>
sourcefn partial_cmp(&self, other: &TargetRef<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &TargetRef<'a>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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<'a> Copy for TargetRef<'a>
impl<'a> Eq for TargetRef<'a>
impl<'a> StructuralEq for TargetRef<'a>
impl<'a> StructuralPartialEq for TargetRef<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for TargetRef<'a>
impl<'a> Send for TargetRef<'a>
impl<'a> Sync for TargetRef<'a>
impl<'a> Unpin for TargetRef<'a>
impl<'a> UnwindSafe for TargetRef<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more