pub enum TypeDelim {
Tupled,
Braced,
}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§
Implementations§
Trait Implementations§
impl Copy for TypeDelim
impl Eq for TypeDelim
impl StructuralPartialEq for TypeDelim
Auto Trait Implementations§
impl Freeze for TypeDelim
impl RefUnwindSafe for TypeDelim
impl Send for TypeDelim
impl Sync for TypeDelim
impl Unpin for TypeDelim
impl UnwindSafe for TypeDelim
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more