pub trait Component {
Show 16 methods
// Required methods
fn render(&self) -> Node;
fn dispatch(&mut self, element_id: &str, event: &str) -> bool;
// Provided methods
fn render_shared(&self) -> Rc<Node> { ... }
fn scene_dirty(&self) -> bool { ... }
fn close_requested(&mut self) -> bool { ... }
fn take_window_close_request(&mut self) -> bool { ... }
fn take_window_commands(&mut self) -> Vec<WindowCommand> { ... }
fn publish_window_status(&self, _status: WindowStatus) { ... }
fn list_rows(&self, _path: &[usize], _rows: Range<usize>) -> Vec<Node> { ... }
fn edit_at(&mut self, _scene: &Node, _path: &[usize], _text: String) -> bool { ... }
fn commit_table_cell(
&mut self,
_scene: &Node,
_path: &[usize],
_original: &str,
_text: String,
) -> bool { ... }
fn adjust_range_at(
&mut self,
_scene: &Node,
_path: &[usize],
_action: RangeAction,
) -> bool { ... }
fn control_at(
&mut self,
_scene: &Node,
_path: &[usize],
_action: ControlAction,
) -> bool { ... }
fn resize_split_at(
&mut self,
_scene: &Node,
_path: &[usize],
_weights: &[(usize, f32)],
) -> bool { ... }
fn resize_split_sizes_at(
&mut self,
_scene: &Node,
_path: &[usize],
_sizes: &[(usize, f32)],
) -> bool { ... }
fn dispatch_at(&mut self, scene: &Node, path: &[usize], event: &str) -> bool { ... }
}Expand description
The backend-independent interface implemented by generated UI components.
Required Methods§
Provided Methods§
Return the current scene. Reactive components may reuse a clean snapshot.
Sourcefn scene_dirty(&self) -> bool
fn scene_dirty(&self) -> bool
Report invalidation caused by a shared reactive dependency.
Sourcefn close_requested(&mut self) -> bool
fn close_requested(&mut self) -> bool
Decide whether the host may close this window.
Sourcefn take_window_close_request(&mut self) -> bool
fn take_window_close_request(&mut self) -> bool
Consume a close command emitted by the component.
Sourcefn take_window_commands(&mut self) -> Vec<WindowCommand>
fn take_window_commands(&mut self) -> Vec<WindowCommand>
Consume presentation commands in the order emitted by the component.
Sourcefn publish_window_status(&self, _status: WindowStatus)
fn publish_window_status(&self, _status: WindowStatus)
Publish native state after reading it from the window backend.
Sourcefn list_rows(&self, _path: &[usize], _rows: Range<usize>) -> Vec<Node>
fn list_rows(&self, _path: &[usize], _rows: Range<usize>) -> Vec<Node>
Render the requested model rows of a virtual view in a base scene.
Sourcefn edit_at(&mut self, _scene: &Node, _path: &[usize], _text: String) -> bool
fn edit_at(&mut self, _scene: &Node, _path: &[usize], _text: String) -> bool
Commit the complete value of an editable text item after input validation.
Sourcefn commit_table_cell(
&mut self,
_scene: &Node,
_path: &[usize],
_original: &str,
_text: String,
) -> bool
fn commit_table_cell( &mut self, _scene: &Node, _path: &[usize], _original: &str, _text: String, ) -> bool
Commit a TableCell or TreeCell draft only if its model row and original value still match.
Sourcefn adjust_range_at(
&mut self,
_scene: &Node,
_path: &[usize],
_action: RangeAction,
) -> bool
fn adjust_range_at( &mut self, _scene: &Node, _path: &[usize], _action: RangeAction, ) -> bool
Apply a range control action through the same path used by pointer and keyboard input.
fn control_at( &mut self, _scene: &Node, _path: &[usize], _action: ControlAction, ) -> bool
fn resize_split_at( &mut self, _scene: &Node, _path: &[usize], _weights: &[(usize, f32)], ) -> bool
fn resize_split_sizes_at( &mut self, _scene: &Node, _path: &[usize], _sizes: &[(usize, f32)], ) -> bool
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".