[][src]Trait kas::LayoutData

pub trait LayoutData {
    type Data: Clone + Debug + Default;
    type Solver: RulesSolver;
    type Setter: RulesSetter;
}

Trait to describe the type needed by the layout implementation.

The (non-trivial) layout engines require a storage field within their widget. For manual Layout implementations this may be specified directly, but to allow the derive(Widget) macro to specify the appropriate data type, a widget should include a field of the following form:

#[layout_data] layout_data: <Self as kas::LayoutData>::Data,

Ideally we would use an inherent associated type on the struct in question, but until rust-lang#8995 is implemented that is not possible. We also cannot place this associated type on the Widget trait itself, since then uses of the trait would require parameterisation. Thus, this trait.

Associated Types

Loading content...

Implementors

impl LayoutData for MessageBox[src]

impl<M: 'static> LayoutData for CheckBox<M>[src]

impl<M: 'static> LayoutData for RadioBox<M>[src]

Loading content...