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 }"
);
}
Variants§
Implementations§
Trait Implementations§
source§impl PartialEq<TypeDelim> for TypeDelim
impl PartialEq<TypeDelim> for TypeDelim
impl Copy for TypeDelim
impl Eq for TypeDelim
impl StructuralEq for TypeDelim
impl StructuralPartialEq for TypeDelim
Auto Trait Implementations§
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