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<&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
sourceimpl<'a> Ord for TargetRef<'a>
impl<'a> Ord for TargetRef<'a>
1.21.0 · sourcefn 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
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<'a> PartialEq<TargetRef<'a>> for TargetRef<'a>
impl<'a> PartialEq<TargetRef<'a>> 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>
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 moreimpl<'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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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