Module suzy::selectable[][src]

An interface for Widgets to respond to interaction.

Widgets like Button require their content implement the trait Selectable so that they can update their graphics in response to a change in the button’s state.

The type SelectableData provides a simple way to select between values.

The type SelectableIgnored provides a no-op implementation of Selectable, in case a particular Widget has no need to respond to a change in selection state.

Selectable implementations are provided with an opaque struct SelectionState. This can be converted into a number of “versioned” enums. This pattern allows additional states to be added in the future with reasonable fallbacks for backwards-compatibility.

Structs

SelectableData

A type which provides a simple implementation of Selectable which selects between a set of values.

SelectableDataBuilder

A builder enables populating the selectable data.

SelectableIgnored

A type which ignores changes to selection state.

SelectionState

A selection state is an opaque type which indicates the current state a selectable widget should transition to.

Enums

SelectionStateV0

Version 0 selection states.

SelectionStateV1

Version 1 selection states.

SelectionStateV2

Version 2 selection states.

Traits

Selectable

A trait which enables a widget to respond to changes in selection state.