Module capability
Expand description
Capabilities: behaviour a widget takes part in beyond pixels and input.
A layer above the toolkit (collaboration, history, fullscreen, native
views, …) defines a capability as a trait and reaches a widget’s
implementation through capability / capability_mut. A widget
declares what it provides in one line inside its impl Widget:
ⓘ
impl Widget for Player {
tilo_ui::provides!(dyn FullscreenProvider, dyn Continuable);
// ...
}A widget that provides nothing needs nothing: the Widget defaults
answer every request with None. A wrapper passes requests to the widget
it wraps by calling its provide/provide_mut.
Structs§
- Request
- A shared-borrow request for one capability, answered by
Widget::provide. - Request
Mut - An exclusive-borrow request for one capability, answered by
Widget::provide_mut.
Functions§
- capability
widget’s implementation of capabilityT(adyn Trait), if it provides one.- capability_
mut - Mutable
capability.