pub struct DebugList<'a> { /* private fields */ }Expand description
A helper designed to assist with creation of
DebugPls implementations for list-like structures.
§Examples
use dbg_pls::{pretty, DebugPls, Formatter};
struct Foo(Vec<i32>);
impl DebugPls for Foo {
fn fmt(&self, f: Formatter<'_>) {
f.debug_list().entries(&self.0).finish()
}
}
let value = Foo(vec![10, 11]);
assert_eq!(format!("{}", pretty(&value)), "[10, 11]");Implementations§
Trait Implementations§
Source§impl<'f, D: DebugPls> Extend<D> for DebugList<'f>
impl<'f, D: DebugPls> Extend<D> for DebugList<'f>
Source§fn extend<T: IntoIterator<Item = D>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = D>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Auto Trait Implementations§
impl<'a> Freeze for DebugList<'a>
impl<'a> RefUnwindSafe for DebugList<'a>
impl<'a> !Send for DebugList<'a>
impl<'a> !Sync for DebugList<'a>
impl<'a> Unpin for DebugList<'a>
impl<'a> !UnwindSafe for DebugList<'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