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 ui_raw(&mut self, ui: &mut Ui, options: Self::Attributes) { ... }
fn setup(app: &mut AppBuilder) { ... } }
Expand description

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.

Default attributes

  • ignore: hides the field in the inspector
  • label: provides a label instead of using the field name
  • read_only: disables the UI
  • collapse: wraps the ui in an [egui::CollapsingHeader].
  • default: only for enums, specifies the default value when selecting a new variant
  • wrapper: wrap field UI in a custom function. Demo in the rust_types example.

Associated Types

type Attributes: Default + Clone[src]

Expand description

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,
}

Required methods

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

Expand description

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

Provided methods

fn ui_raw(&mut self, ui: &mut Ui, options: Self::Attributes)[src]

Expand description

Displays the value without any context. Useful for usage outside of the plugins, where there is no access to the world or EguiContext.

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

Expand description

Required setup for the bevy application, e.g. registering events. Note that this method will run for every instance of a type.

Implementations on Foreign Types

impl Inspectable for Light[src]

type Attributes = ()

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

impl Inspectable for ColorMaterial[src]

type Attributes = ()

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

impl Inspectable for PrimitiveTopology[src]

type Attributes = ()

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

impl Inspectable for WindowOrigin[src]

type Attributes = ()

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

impl Inspectable for ScalingMode[src]

type Attributes = ()

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

impl Inspectable for DepthCalculation[src]

type Attributes = ()

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

impl Inspectable for Cube[src]

type Attributes = ()

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

impl Inspectable for Quad[src]

type Attributes = ()

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

impl Inspectable for Plane[src]

type Attributes = ()

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

impl Inspectable for Capsule[src]

type Attributes = ()

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

impl Inspectable for CapsuleUvProfile[src]

type Attributes = ()

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

impl Inspectable for Icosphere[src]

type Attributes = ()

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

impl Inspectable for Torus[src]

type Attributes = ()

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

impl Inspectable for Box[src]

type Attributes = ()

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

impl Inspectable for Transform[src]

type Attributes = ()

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

impl Inspectable for GlobalTransform[src]

type Attributes = <Transform as Inspectable>::Attributes

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

impl Inspectable for Mat3[src]

type Attributes = ()

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

impl Inspectable for Mat4[src]

type Attributes = ()

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

impl Inspectable for Color[src]

type Attributes = ColorAttributes

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

impl Inspectable for AmbientLight[src]

type Attributes = <Color as Inspectable>::Attributes

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

impl Inspectable for ClearColor[src]

type Attributes = <Color as Inspectable>::Attributes

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

impl Inspectable for Rect[src]

type Attributes = ()

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

impl Inspectable for TextureAtlasSprite[src]

type Attributes = ()

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

impl Inspectable for TextureAtlas[src]

type Attributes = ()

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

impl Inspectable for StandardMaterial[src]

type Attributes = ()

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

impl Inspectable for Mesh[src]

type Attributes = ()

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

impl Inspectable for Name[src]

type Attributes = ()

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

impl Inspectable for VisibleEntities[src]

type Attributes = ()

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

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

type Attributes = T::Attributes

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

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

type Attributes = <T as Inspectable>::Attributes

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

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

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

type Attributes = <T as Inspectable>::Attributes

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

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

impl Inspectable for ()[src]

type Attributes = ()

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

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

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

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

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

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

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

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

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

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

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)

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

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

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)

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

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

impl Inspectable for String[src]

type Attributes = StringAttributes

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

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

type Attributes = ()

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

impl Inspectable for bool[src]

type Attributes = ()

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

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

type Attributes = T::Attributes

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

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

type Attributes = T::Attributes

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

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

type Attributes = OptionAttributes<T>

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

impl Inspectable for Duration[src]

type Attributes = ()

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

impl Inspectable for Quat[src]

type Attributes = QuatAttributes

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

impl Inspectable for Display[src]

type Attributes = ()

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

impl Inspectable for FocusPolicy[src]

type Attributes = ()

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

impl Inspectable for VerticalAlign[src]

type Attributes = ()

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

impl Inspectable for HorizontalAlign[src]

type Attributes = ()

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

impl Inspectable for PositionType[src]

type Attributes = ()

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

impl Inspectable for Direction[src]

type Attributes = ()

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

impl Inspectable for FlexDirection[src]

type Attributes = ()

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

impl Inspectable for FlexWrap[src]

type Attributes = ()

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

impl Inspectable for AlignItems[src]

type Attributes = ()

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

impl Inspectable for AlignSelf[src]

type Attributes = ()

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

impl Inspectable for AlignContent[src]

type Attributes = ()

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

impl Inspectable for JustifyContent[src]

type Attributes = ()

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

impl Inspectable for TextAlignment[src]

type Attributes = ()

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

impl Inspectable for TextStyle[src]

type Attributes = ()

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

impl Inspectable for TextSection[src]

type Attributes = ()

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

impl Inspectable for Text[src]

type Attributes = ()

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

impl Inspectable for Style[src]

type Attributes = ()

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

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

type Attributes = T::Attributes

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

impl Inspectable for Val[src]

type Attributes = ()

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

impl Inspectable for Vec2[src]

type Attributes = Vec2dAttributes

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

impl Inspectable for Vec3[src]

type Attributes = NumberAttributes<Vec3>

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

impl Inspectable for Vec4[src]

type Attributes = NumberAttributes<Vec4>

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

impl Inspectable for HandleId[src]

type Attributes = ()

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

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

type Attributes = T::Attributes

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

impl Inspectable for Handle<Texture>[src]

type Attributes = TextureAttributes

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

impl Inspectable for Handle<Font>[src]

type Attributes = ()

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

impl Inspectable for World[src]

type Attributes = WorldInspectorParams

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

impl Inspectable for Entity[src]

type Attributes = EntityAttributes

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

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

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

impl<'w, Q, F> Inspectable for InspectorQuerySingle<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

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

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

type Attributes = ButtonAttributes

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

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

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

type Attributes = WindowAttributes<T>

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

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

type Attributes = T::Attributes

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

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

type Attributes = NumberAttributes<T>

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

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

type Attributes = ()

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