pub trait DisplayBTreeSetExt<'a, T: Display> {
// Required method
fn display(&'a self) -> DisplayBTreeSet<'a, T>;
// Provided method
fn display_n(&'a self, n: usize) -> DisplayBTreeSet<'a, T> { ... }
}Expand description
Implement Display for BTreeSet<T> if T is Display.
It outputs at most MAX elements, excluding those from the 5th to the second-to-last one:
DisplayBTreeSet([1,2,3,4,5,6])outputs:"[1,2,3,4,..,6]".
§Example
use std::collections::BTreeSet;
use display_more::DisplayBTreeSetExt;
let a = (1..=6).collect::<BTreeSet<_>>();
assert_eq!(a.display().to_string(), "[1,2,3,4,..,6]");Required Methods§
fn display(&'a self) -> DisplayBTreeSet<'a, T>
Provided Methods§
Sourcefn display_n(&'a self, n: usize) -> DisplayBTreeSet<'a, T>
fn display_n(&'a self, n: usize) -> DisplayBTreeSet<'a, T>
Display at most n elements.