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

Adds the entry to the set output.

Adds all the entries to the set output.

Closes off the set.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.