Enum const_panic::fmt::TypeDelim
source · 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 }"
);
}