bevy_reflect

Function enum_debug

Source
pub fn enum_debug(dyn_enum: &dyn Enum, f: &mut Formatter<'_>) -> Result
Expand description

The default debug formatter for Enum types.

ยงExample

use bevy_reflect::Reflect;
#[derive(Reflect)]
enum MyEnum {
  A,
  B (usize),
  C {value: i32}
}

let my_enum: &dyn Reflect = &MyEnum::B(123);
println!("{:#?}", my_enum);

// Output:

// B (
//   123,
// )