Skip to main content

WidgetInput

Trait WidgetInput 

Source
pub trait WidgetInput:
    Sized
    + Send
    + Sync
    + 'static {
    // Required method
    fn render_input(ui: &mut Ui<'_>, label: &str) -> Self;
}
Expand description

Trait for types that can be automatically rendered as an input widget.

Required Methods§

Source

fn render_input(ui: &mut Ui<'_>, label: &str) -> Self

Render this type’s input widget and return the current value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl WidgetInput for bool

Source§

fn render_input(ui: &mut Ui<'_>, label: &str) -> Self

Source§

impl WidgetInput for f32

Source§

fn render_input(ui: &mut Ui<'_>, label: &str) -> Self

Renders as number_input returning f64, then converts to f32. Minor precision loss is possible for values beyond f32 range.

Source§

impl WidgetInput for f64

Source§

fn render_input(ui: &mut Ui<'_>, label: &str) -> Self

Source§

impl WidgetInput for i64

Source§

fn render_input(ui: &mut Ui<'_>, label: &str) -> Self

Source§

impl WidgetInput for String

Source§

fn render_input(ui: &mut Ui<'_>, label: &str) -> Self

Implementors§