pub struct DebugSet<'a> { /* private fields */ }Expand description
A helper designed to assist with creation of
DebugPls implementations for sets.
§Examples
use dbg_pls::{pretty, DebugPls, Formatter};
use std::collections::BTreeSet;
struct Foo(BTreeSet<String>);
impl DebugPls for Foo {
fn fmt(&self, f: Formatter) {
f.debug_set().entries(&self.0).finish()
}
}
let mut value = Foo(BTreeSet::from([
"Hello".to_string(),
"World".to_string(),
]));
assert_eq!(
format!("{}", pretty(&value)),
"{
\"Hello\";
\"World\"
}",
);Implementations§
Auto Trait Implementations§
impl<'a> Freeze for DebugSet<'a>
impl<'a> RefUnwindSafe for DebugSet<'a>
impl<'a> !Send for DebugSet<'a>
impl<'a> !Sync for DebugSet<'a>
impl<'a> Unpin for DebugSet<'a>
impl<'a> !UnwindSafe for DebugSet<'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