Skip to main content

Component

Trait Component 

Source
pub trait Component: Any + Unpin {
    type Props<'a>: Props
       where Self: 'a;

    // Required method
    fn new(props: &Self::Props<'_>) -> Self;

    // Provided methods
    fn update(
        &mut self,
        _props: &mut Self::Props<'_>,
        _hooks: Hooks<'_, '_>,
        _updater: &mut ComponentUpdater<'_, '_>,
    ) { ... }
    fn draw(&mut self, _drawer: &mut ComponentDrawer<'_, '_>) { ... }
    fn calc_children_areas(
        &self,
        children: &Components,
        layout_style: &LayoutStyle,
        drawer: &mut ComponentDrawer<'_, '_>,
    ) -> Vec<Rect> { ... }
    fn poll_change(&mut self, _cx: &mut Context<'_>) -> Poll<()> { ... }
}

Required Associated Types§

Source

type Props<'a>: Props where Self: 'a

Required Methods§

Source

fn new(props: &Self::Props<'_>) -> Self

Provided Methods§

Source

fn update( &mut self, _props: &mut Self::Props<'_>, _hooks: Hooks<'_, '_>, _updater: &mut ComponentUpdater<'_, '_>, )

Source

fn draw(&mut self, _drawer: &mut ComponentDrawer<'_, '_>)

Source

fn calc_children_areas( &self, children: &Components, layout_style: &LayoutStyle, drawer: &mut ComponentDrawer<'_, '_>, ) -> Vec<Rect>

Source

fn poll_change(&mut self, _cx: &mut Context<'_>) -> Poll<()>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Component for AlertModal

Source§

impl Component for Border

Source§

type Props<'a> = BorderProps<'a>

Source§

impl Component for Center

Source§

type Props<'a> = CenterProps<'a>

Source§

impl Component for ConfirmModal

Source§

impl Component for ContextProvider

Source§

impl Component for Fragment

Source§

impl Component for Modal

Source§

type Props<'a> = ModalProps<'a>

Source§

impl Component for PaletteProvider

Source§

impl Component for Positioned

Source§

impl Component for ScrollView

Source§

impl Component for ShortcutInfoModal

Source§

impl Component for Text

Source§

impl Component for View

Source§

type Props<'a> = ViewProps<'a>

Source§

impl Component for WrappedText

Source§

impl<T> Component for MultiSelect<T>
where T: Into<ListItem<'static>> + Clone + Send + Sync + 'static,

Source§

impl<T> Component for Select<T>
where T: Into<ListItem<'static>> + Clone + Send + Sync + 'static,

Source§

impl<T> Component for StatefulWidgetAdapter<T>
where T: StatefulWidget + 'static + Unpin + Clone, T::State: Sized + Sync + Send + 'static + Unpin, for<'a> &'a T: StatefulWidget<State = T::State>,

Source§

impl<T> Component for ThemeOverride<T>
where T: ComponentTheme,

Source§

impl<T> Component for WidgetAdapter<T>
where T: 'static + Unpin + Clone + Widget,