pub trait Operation<T = ()>: Send {
// Required method
fn container(
&mut self,
id: Option<&Id>,
bounds: Rectangle,
operate_on_children: &mut dyn FnMut(&mut dyn Operation<T>),
);
// Provided methods
fn focusable(
&mut self,
_id: Option<&Id>,
_bounds: Rectangle,
_state: &mut dyn Focusable,
) { ... }
fn scrollable(
&mut self,
_id: Option<&Id>,
_bounds: Rectangle,
_content_bounds: Rectangle,
_translation: Vector,
_state: &mut dyn Scrollable,
) { ... }
fn text_input(
&mut self,
_id: Option<&Id>,
_bounds: Rectangle,
_state: &mut dyn TextInput,
) { ... }
fn text(&mut self, _id: Option<&Id>, _bounds: Rectangle, _text: &str) { ... }
fn custom(
&mut self,
_id: Option<&Id>,
_bounds: Rectangle,
_state: &mut (dyn Any + 'static),
) { ... }
fn finish(&self) -> Outcome<T> { ... }
}
Available on crate feature
advanced
only.Expand description
A piece of logic that can traverse the widget tree of an application in order to query or update some widget state.
Required Methods§
Provided Methods§
Sourcefn focusable(
&mut self,
_id: Option<&Id>,
_bounds: Rectangle,
_state: &mut dyn Focusable,
)
fn focusable( &mut self, _id: Option<&Id>, _bounds: Rectangle, _state: &mut dyn Focusable, )
Operates on a widget that can be focused.
Sourcefn scrollable(
&mut self,
_id: Option<&Id>,
_bounds: Rectangle,
_content_bounds: Rectangle,
_translation: Vector,
_state: &mut dyn Scrollable,
)
fn scrollable( &mut self, _id: Option<&Id>, _bounds: Rectangle, _content_bounds: Rectangle, _translation: Vector, _state: &mut dyn Scrollable, )
Operates on a widget that can be scrolled.
Sourcefn text_input(
&mut self,
_id: Option<&Id>,
_bounds: Rectangle,
_state: &mut dyn TextInput,
)
fn text_input( &mut self, _id: Option<&Id>, _bounds: Rectangle, _state: &mut dyn TextInput, )
Operates on a widget that has text input.
Sourcefn text(&mut self, _id: Option<&Id>, _bounds: Rectangle, _text: &str)
fn text(&mut self, _id: Option<&Id>, _bounds: Rectangle, _text: &str)
Operates on a widget that contains some text.