Trait fyrox_ui::BaseControl

source ·
pub trait BaseControl: 'static {
    // Required methods
    fn as_any(&self) -> &dyn Any;
    fn as_any_mut(&mut self) -> &mut dyn Any;
    fn clone_boxed(&self) -> Box<dyn Control>;
    fn type_name(&self) -> &'static str;
}
Expand description

Base trait for all UI widgets. It has auto-impl and you don’t need to implement it manually. Your widget must implement Clone and Control traits for impl to be generated for you, also your widget must not contain any references (due to 'static lifetime requirement).

Required Methods§

source

fn as_any(&self) -> &dyn Any

Returns self as &dyn Any.

source

fn as_any_mut(&mut self) -> &mut dyn Any

Returns self as &mut dyn Any.

source

fn clone_boxed(&self) -> Box<dyn Control>

Returns the exact copy of the widget in “type-erased” form.

source

fn type_name(&self) -> &'static str

Returns type name of the widget.

Implementors§

source§

impl<T: Any + Clone + 'static + Control> BaseControl for T