pub enum NameKey<'a> {
Borrowed(&'a Name),
Owned(Name),
}
Expand description
A Name
type used for efficient lookups in ordered collections.
This type’s Ord
implementation provides a stable ordering that is
efficient and does not rely on string comparisons. However, it does not sort
ascending, while Name
’s Ord
implementation sorts ascending.
There is no benefit to using this type in a hash-based collection, so this
type does not implement Hash
.
Variants§
Trait Implementations§
source§impl<'a> Ord for NameKey<'a>
impl<'a> Ord for NameKey<'a>
source§impl<'a, 'b> PartialEq<NameKey<'b>> for NameKey<'a>
impl<'a, 'b> PartialEq<NameKey<'b>> for NameKey<'a>
source§impl<'a, 'b> PartialOrd<NameKey<'b>> for NameKey<'a>
impl<'a, 'b> PartialOrd<NameKey<'b>> for NameKey<'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> Eq for NameKey<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for NameKey<'a>
impl<'a> Send for NameKey<'a>
impl<'a> Sync for NameKey<'a>
impl<'a> Unpin for NameKey<'a>
impl<'a> UnwindSafe for NameKey<'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