Trait Component

Source
pub trait Component: StateMachineChild + DynClone {
    type Props: 'static;

    // Required method
    fn layout(
        &self,
        state: &mut StateManager,
        driver: &Driver,
        window: &Arc<SourceID>,
    ) -> Box<dyn Layout<Self::Props> + 'static>;
}

Required Associated Types§

Source

type Props: 'static

Required Methods§

Source

fn layout( &self, state: &mut StateManager, driver: &Driver, window: &Arc<SourceID>, ) -> Box<dyn Layout<Self::Props> + 'static>

Trait Implementations§

Source§

impl<U: ?Sized> ComponentWrap<U> for Box<dyn Component<Props = PropBag>>
where for<'a> &'a U: From<&'a PropBag>,

Source§

fn layout( &self, manager: &mut StateManager, driver: &Driver, window: &Arc<SourceID>, ) -> Box<dyn Layout<U> + 'static>

Source§

impl FromLua for Box<dyn Component<Props = PropBag>>

Source§

fn from_lua(value: Value, _: &Lua) -> Result<Self>

Performs the conversion.
Source§

impl StateMachineChild for Box<dyn Component<Props = PropBag>>

Source§

fn id(&self) -> Arc<SourceID>

Source§

fn init( &self, driver: &Weak<Driver>, ) -> Result<Box<dyn StateMachineWrapper>, Error>

Source§

fn apply_children( &self, f: &mut dyn FnMut(&dyn StateMachineChild) -> Result<()>, ) -> Result<()>

Source§

impl UserData for Box<dyn Component<Props = PropBag>>

Source§

fn add_fields<F>(fields: &mut F)
where F: UserDataFields<Self>,

Adds custom fields specific to this userdata.
Source§

fn add_methods<M>(methods: &mut M)
where M: UserDataMethods<Self>,

Adds custom methods and operators specific to this userdata.
Source§

fn register(registry: &mut UserDataRegistry<Self>)

Registers this type for use in Lua. Read more

Implementors§

Source§

impl Component for Window

Source§

impl<T: Empty + 'static> Component for DomainLine<T>
where for<'a> &'a T: Into<&'a (dyn Empty + 'static)>,

Source§

type Props = T

Source§

impl<T: Empty + 'static> Component for Line<T>
where for<'a> &'a T: Into<&'a (dyn Empty + 'static)>,

Source§

type Props = T

Source§

impl<T: Prop + 'static> Component for DomainPoint<T>
where for<'a> &'a T: Into<&'a (dyn Prop + 'static)>,

Source§

type Props = T

Source§

impl<T: Prop + 'static> Component for Button<T>
where for<'a> &'a T: Into<&'a (dyn Prop + 'static)>,

Source§

type Props = T

Source§

impl<T: Prop + 'static> Component for ScrollArea<T>
where for<'a> &'a T: Into<&'a (dyn Prop + 'static)>,

Source§

type Props = T

Source§

impl<T: Prop + Default + 'static> Component for Region<T>
where for<'a> &'a T: Into<&'a (dyn Prop + 'static)>,

Source§

type Props = T

Source§

impl<T: Prop + 'static> Component for FlexBox<T>

Source§

type Props = T

Source§

impl<T: Prop + 'static> Component for Paragraph<T>

Source§

type Props = T

Source§

impl<T: Prop + 'static> Component for GridBox<T>

Source§

type Props = T

Source§

impl<T: Padded + 'static> Component for Text<T>
where for<'a> &'a T: Into<&'a (dyn Padded + 'static)>,

Source§

type Props = T

Source§

impl<T: Padded + 'static, const KIND: u8> Component for Shape<T, KIND>
where for<'a> &'a T: Into<&'a (dyn Padded + 'static)>,

Source§

type Props = T

Source§

impl<T: Prop + 'static> Component for MouseArea<T>
where for<'a> &'a T: Into<&'a (dyn Prop + 'static)>,

Source§

type Props = T

Source§

impl<T: Prop + 'static> Component for ListBox<T>

Source§

type Props = T

Source§

impl<T: Prop + 'static> Component for TextBox<T>

Source§

type Props = T