pub struct DebugTuple<'a> { /* private fields */ }
Expand description

A helper designed to assist with creation of DebugPls implementations for tuples.

Examples

use dbg_pls::{pretty, DebugPls, Formatter};

struct Foo(i32, String);

impl DebugPls for Foo {
    fn fmt(&self, f: Formatter) {
        f.debug_tuple()
            .field(&self.0)
            .field(&self.1)
            .finish()
    }
}

let value = Foo(10, "Hello".to_string());
assert_eq!(format!("{}", pretty(&value)), "(10, \"Hello\")");

Implementations

Adds the field to the tuple output.

Closes off the tuple.

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.