Trait kas::LayoutData[][src]

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

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

Implementations on Foreign Types

Implementors