pub enum TargetRef<'a> {
Object(&'a oid),
Symbolic(&'a FullNameRef),
}
Expand description
Denotes a ref target, equivalent to Kind
, but with immutable data.
Variants§
Object(&'a oid)
A ref that points directly 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 TargetRef<'_>
impl TargetRef<'_>
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> PartialOrd for TargetRef<'a>
impl<'a> PartialOrd for TargetRef<'a>
impl<'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