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 for TargetRef<'a>
impl<'a> PartialEq for TargetRef<'a>
source§impl<'a> PartialOrd for TargetRef<'a>
impl<'a> PartialOrd 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 moreimpl<'a> Copy for TargetRef<'a>
impl<'a> Eq for TargetRef<'a>
impl<'a> StructuralPartialEq for TargetRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for TargetRef<'a>
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§
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