pub enum TypeDelim {
    Tupled,
    Braced,
}
Available on crate feature non_basic only.
Expand description

Whether a struct or variant is Tupled or Braced.

Unit structs/variants are considered braced.

Example

Formatting

use const_panic::{
    fmt::{self, FmtArg, TypeDelim},
    ArrayString,
    flatten_panicvals,
};

{
    assert_eq!(
        const_panic::concat_!(FmtArg::DEBUG;
            "Foo",
            open: TypeDelim::Tupled.open(),
                10u8, fmt::COMMA_SEP,
                false, fmt::COMMA_TERM,
            close: TypeDelim::Tupled.close(),
        ),
        "Foo(10, false)"
    );
}

{
    assert_eq!(
        const_panic::concat_!(FmtArg::DEBUG;
            "Bar",
            open: TypeDelim::Braced.open(),
                "x: ", debug: "hello", fmt::COMMA_SEP,
                "y: ", true, fmt::COMMA_TERM,
            close: TypeDelim::Braced.close(),
        ),
        "Bar { x: \"hello\", y: true }"
    );
}

Variants§

§

Tupled

A Foo(Bar) type or variant

§

Braced

A Foo{bar: Baz} type or variant

Implementations§

Gets the delimiters that surround the fields of a struct or variant.

Gets the group delimiter that precedes the fields of a struct or variant.

Gets the group delimiter that follows the fields of a struct or variant.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

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.

A constant of the type witness

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.