Trait bevy_inspector_egui::Inspectable[][src]

pub trait Inspectable {
    type Attributes: Default + Clone;
    fn ui(
        &mut self,
        ui: &mut Ui,
        options: Self::Attributes,
        context: &Context<'_>
    ) -> bool; fn setup(app: &mut AppBuilder) { ... } }

This trait describes how a struct should be displayed. It can be derived for structs and enums, see the crate-level docs for how to do that.

Associated Types

type Attributes: Default + Clone[src]

The Attributes associated type specifies what attributes can be passed to a field. See the following snippet for an example:

struct MyCustomType;
struct MyWidgetAttributes { a: f32, b: Option<String> }

impl Inspectable for MyCustomType {
  type Attributes = MyWidgetAttributes;

  fn ui(&mut self, _: &mut egui::Ui, options: MyWidgetAttributes, context: &Context) -> bool {
    println!("a = {}, b = {:?}", options.a, options.b);
    false
  }
}

// ...

#[derive(Inspectable)]
struct InspectorData {
  #[inspectable(a = 10.0, b = None)]
  value: MyCustomType,
}
Loading content...

Required methods

fn ui(
    &mut self,
    ui: &mut Ui,
    options: Self::Attributes,
    context: &Context<'_>
) -> bool
[src]

This methods is responsible for building the egui ui. Returns whether any data was modified.

Loading content...

Provided methods

fn setup(app: &mut AppBuilder)[src]

Required setup for the bevy application, e.g. registering Resources.

Loading content...

Implementations on Foreign Types

impl Inspectable for Light[src]

type Attributes = ()

impl Inspectable for ColorMaterial[src]

type Attributes = ()

impl Inspectable for PrimitiveTopology[src]

type Attributes = ()

impl Inspectable for WindowOrigin[src]

type Attributes = ()

impl Inspectable for ScalingMode[src]

type Attributes = ()

impl Inspectable for DepthCalculation[src]

type Attributes = ()

impl Inspectable for Cube[src]

type Attributes = ()

impl Inspectable for Quad[src]

type Attributes = ()

impl Inspectable for Plane[src]

type Attributes = ()

impl Inspectable for Capsule[src]

type Attributes = ()

impl Inspectable for CapsuleUvProfile[src]

type Attributes = ()

impl Inspectable for Icosphere[src]

type Attributes = ()

impl Inspectable for Torus[src]

type Attributes = ()

impl Inspectable for Box[src]

type Attributes = ()

impl Inspectable for Transform[src]

type Attributes = ()

impl Inspectable for GlobalTransform[src]

type Attributes = <Transform as Inspectable>::Attributes

impl Inspectable for Mat3[src]

type Attributes = ()

impl Inspectable for Mat4[src]

type Attributes = ()

impl Inspectable for Color[src]

type Attributes = ColorAttributes

impl Inspectable for AmbientLight[src]

type Attributes = <Color as Inspectable>::Attributes

impl Inspectable for ClearColor[src]

type Attributes = <Color as Inspectable>::Attributes

impl Inspectable for Rect[src]

type Attributes = ()

impl Inspectable for TextureAtlasSprite[src]

type Attributes = ()

impl Inspectable for TextureAtlas[src]

type Attributes = ()

impl Inspectable for StandardMaterial[src]

type Attributes = ()

impl Inspectable for Mesh[src]

type Attributes = ()

impl Inspectable for Name[src]

type Attributes = ()

impl Inspectable for VisibleEntities[src]

type Attributes = ()

impl<'a, T: Inspectable> Inspectable for Mut<'a, T>[src]

type Attributes = T::Attributes

impl<T> Inspectable for Vec<T> where
    T: Inspectable + Default
[src]

type Attributes = <T as Inspectable>::Attributes

impl<T: Inspectable, const N: usize> Inspectable for [T; N][src]

type Attributes = <T as Inspectable>::Attributes

impl Inspectable for ()[src]

type Attributes = ()

impl<A: Inspectable + 'static> Inspectable for (A,)[src]

type Attributes = (<A as Inspectable>::Attributes,)

impl<A: Inspectable + 'static, B: Inspectable + 'static> Inspectable for (A, B)[src]

type Attributes = (<A as Inspectable>::Attributes, <B as Inspectable>::Attributes)

impl<A: Inspectable + 'static, B: Inspectable + 'static, C: Inspectable + 'static> Inspectable for (A, B, C)[src]

type Attributes = (<A as Inspectable>::Attributes, <B as Inspectable>::Attributes, <C as Inspectable>::Attributes)

impl<A: Inspectable + 'static, B: Inspectable + 'static, C: Inspectable + 'static, D: Inspectable + 'static> Inspectable for (A, B, C, D)[src]

type Attributes = (<A as Inspectable>::Attributes, <B as Inspectable>::Attributes, <C as Inspectable>::Attributes, <D as Inspectable>::Attributes)

impl Inspectable for String[src]

type Attributes = StringAttributes

impl<'a> Inspectable for &'a str[src]

type Attributes = ()

impl Inspectable for bool[src]

type Attributes = ()

impl<T> Inspectable for RangeInclusive<T> where
    T: Inspectable + Default
[src]

type Attributes = T::Attributes

impl<T> Inspectable for Range<T> where
    T: Inspectable + Default
[src]

type Attributes = T::Attributes

impl<T: Inspectable> Inspectable for Option<T>[src]

type Attributes = OptionAttributes<T>

impl Inspectable for Duration[src]

type Attributes = ()

impl Inspectable for Quat[src]

type Attributes = QuatAttributes

impl Inspectable for Display[src]

type Attributes = ()

impl Inspectable for FocusPolicy[src]

type Attributes = ()

impl Inspectable for VerticalAlign[src]

type Attributes = ()

impl Inspectable for HorizontalAlign[src]

type Attributes = ()

impl Inspectable for PositionType[src]

type Attributes = ()

impl Inspectable for Direction[src]

type Attributes = ()

impl Inspectable for FlexDirection[src]

type Attributes = ()

impl Inspectable for FlexWrap[src]

type Attributes = ()

impl Inspectable for AlignItems[src]

type Attributes = ()

impl Inspectable for AlignSelf[src]

type Attributes = ()

impl Inspectable for AlignContent[src]

type Attributes = ()

impl Inspectable for JustifyContent[src]

type Attributes = ()

impl Inspectable for TextAlignment[src]

type Attributes = ()

impl Inspectable for TextStyle[src]

type Attributes = ()

impl Inspectable for TextSection[src]

type Attributes = ()

impl Inspectable for Text[src]

type Attributes = ()

impl Inspectable for Style[src]

type Attributes = ()

impl<T: Inspectable + Reflect + PartialEq> Inspectable for Size<T>[src]

type Attributes = T::Attributes

impl Inspectable for Val[src]

type Attributes = ()

impl Inspectable for Vec2[src]

type Attributes = Vec2dAttributes

impl Inspectable for Vec3[src]

type Attributes = NumberAttributes<Vec3>

impl Inspectable for Vec4[src]

type Attributes = NumberAttributes<Vec4>

impl Inspectable for HandleId[src]

type Attributes = ()

impl<T: Asset + Inspectable> Inspectable for Handle<T>[src]

type Attributes = T::Attributes

impl Inspectable for Handle<Texture>[src]

type Attributes = TextureAttributes

impl Inspectable for Handle<Font>[src]

type Attributes = ()

impl Inspectable for World[src]

type Attributes = WorldInspectorParams

impl Inspectable for Entity[src]

type Attributes = EntityAttributes

Loading content...

Implementors

impl<'w, Q, F> Inspectable for InspectorQuery<Q, F> where
    Q: WorldQuery,
    F: WorldQuery,
    F::Fetch: FilterFetch,
    <<Q as WorldQuery>::Fetch as Fetch<'static>>::Item: Inspectable
[src]

type Attributes = <<<Q as WorldQuery>::Fetch as Fetch<'static>>::Item as Inspectable>::Attributes

impl<E: Component + Default> Inspectable for InspectableButton<E>[src]

type Attributes = ButtonAttributes

impl<T: Inspectable + 'static> Inspectable for InNewWindow<T>[src]

type Attributes = WindowAttributes<T>

impl<T: Inspectable + Send + Sync + 'static> Inspectable for ResourceInspector<T>[src]

type Attributes = T::Attributes

impl<T: Num> Inspectable for T[src]

type Attributes = NumberAttributes<T>

impl<T: Reflect> Inspectable for ReflectedUI<T>[src]

type Attributes = ()

Loading content...