pub struct SortedHashMapDebugOutput<'a, K, V>(pub &'a HashMap<K, V>);
Expand description
A wrapper for HashMap
which sorts itself for Debug
output
You probably want to use a BTreeMap
if you want your
data to be sorted, but if outputting is rare (or is only included transiently for
debugging purposes), it may make more sense to use this trait instead of changing the
underlying type.
Also see SortedOutputExt
for a syntactically cleaner method of constructing this type.
Tuple Fields§
§0: &'a HashMap<K, V>
Trait Implementations§
Auto Trait Implementations§
impl<'a, K, V> Freeze for SortedHashMapDebugOutput<'a, K, V>
impl<'a, K, V> RefUnwindSafe for SortedHashMapDebugOutput<'a, K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<'a, K, V> Send for SortedHashMapDebugOutput<'a, K, V>
impl<'a, K, V> Sync for SortedHashMapDebugOutput<'a, K, V>
impl<'a, K, V> Unpin for SortedHashMapDebugOutput<'a, K, V>
impl<'a, K, V> UnwindSafe for SortedHashMapDebugOutput<'a, K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more