pub trait ParamWidget {
    type State: Default;

    // Required method
    fn into_widget_element<'a, P: Param>(
        param: &'a P,
        state: &'a mut Self::State
    ) -> Element<'a, ParamMessage>;

    // Provided method
    unsafe fn into_widget_element_raw<'a>(
        param: &ParamPtr,
        state: &'a mut Self::State
    ) -> Element<'a, ParamMessage> { ... }
}
Expand description

A widget that can be used to create a generic UI with. This is used in conjuction with empty structs to emulate existential types.

Required Associated Types§

source

type State: Default

The type of state stores by this parameter type.

Required Methods§

source

fn into_widget_element<'a, P: Param>( param: &'a P, state: &'a mut Self::State ) -> Element<'a, ParamMessage>

Create an [Element] for a widget for the specified parameter.

Provided Methods§

source

unsafe fn into_widget_element_raw<'a>( param: &ParamPtr, state: &'a mut Self::State ) -> Element<'a, ParamMessage>

The same as into_widget_element(), but for a ParamPtr.

Safety

Undefined behavior of the ParamPtr does not point to a valid parameter.

Implementors§