Struct core::fmt::DebugTuple1.2.0 [] [src]

pub struct DebugTuple<'a, 'b: 'a> { /* fields omitted */ }

A struct to help with fmt::Debug implementations.

This is useful when you wish to output a formatted tuple as a part of your Debug::fmt implementation.

This can be constructed by the Formatter::debug_tuple method.


use std::fmt;

struct Foo(i32, String);

impl fmt::Debug for Foo {
    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {

// prints "Foo(10, "Hello World")"
println!("{:?}", Foo(10, "Hello World".to_string()));Run


impl<'a, 'b: 'a> DebugTuple<'a, 'b>


Adds a new field to the generated tuple struct output.


Finishes output and returns any error encountered.