pub struct Tree {
pub widget: Widget,
pub expander: Handle<UiNode>,
pub content: Handle<UiNode>,
pub panel: Handle<UiNode>,
pub is_expanded: bool,
pub background: Handle<UiNode>,
pub items: Vec<Handle<UiNode>>,
pub is_selected: bool,
pub always_show_expander: bool,
}Expand description
Tree widget allows you to create views for hierarchical data. It could be used to show file system entries, graphs, and anything else that could be represented as a tree.
§Examples
A simple tree with one root and two children items could be created like so:
fn create_tree(ctx: &mut BuildContext) -> Handle<UiNode> {
// Note, that `TreeRoot` widget is mandatory here. Otherwise some functionality of
// descendant trees won't work.
TreeRootBuilder::new(WidgetBuilder::new())
.with_items(vec![TreeBuilder::new(WidgetBuilder::new())
.with_content(
TextBuilder::new(WidgetBuilder::new())
.with_text("Root Item 0")
.build(ctx),
)
.with_items(vec![
TreeBuilder::new(WidgetBuilder::new())
.with_content(
TextBuilder::new(WidgetBuilder::new())
.with_text("Child Item 0")
.build(ctx),
)
.build(ctx),
TreeBuilder::new(WidgetBuilder::new())
.with_content(
TextBuilder::new(WidgetBuilder::new())
.with_text("Child Item 1")
.build(ctx),
)
.build(ctx),
])
.build(ctx)])
.build(ctx)
}Note, that TreeRoot widget is mandatory here. Otherwise some functionality of descendant trees
won’t work (primarily - selection). See TreeRoot docs for more detailed explanation.
§Built-in controls
Tree widget is a rich control element, which has its own set of controls:
Any Mouse Button - select.
Ctrl+Click - enables multi-selection.
Alt+Click - prevents selection allowing you to use drag’n’drop.
Shift+Click - selects a span of items.
Fields§
§widget: WidgetBase widget of the tree.
expander: Handle<UiNode>Current expander of the tree. Usually, it is just a handle of CheckBox widget.
content: Handle<UiNode>Current content of the tree.
panel: Handle<UiNode>Current layout panel, that used to arrange children items.
is_expanded: boolA flag, that indicates whether the tree is expanded or not.
background: Handle<UiNode>Current background widget of the tree.
items: Vec<Handle<UiNode>>Current set of items of the tree.
is_selected: boolA flag, that defines whether the tree is selected or not.
always_show_expander: boolA flag, that defines whether the tree should always show its expander, even if there’s no children elements, or not.
Implementations§
source§impl Tree
impl Tree
pub const WIDGET: &'static str = "widget"
pub const EXPANDER: &'static str = "expander"
pub const CONTENT: &'static str = "content"
pub const PANEL: &'static str = "panel"
pub const IS_EXPANDED: &'static str = "is_expanded"
pub const BACKGROUND: &'static str = "background"
pub const ITEMS: &'static str = "items"
pub const IS_SELECTED: &'static str = "is_selected"
pub const ALWAYS_SHOW_EXPANDER: &'static str = "always_show_expander"
Methods from Deref<Target = Widget>§
pub const HANDLE: &'static str = "handle"
pub const NAME: &'static str = "name"
pub const DESIRED_LOCAL_POSITION: &'static str = "desired_local_position"
pub const WIDTH: &'static str = "width"
pub const HEIGHT: &'static str = "height"
pub const MIN_SIZE: &'static str = "min_size"
pub const MAX_SIZE: &'static str = "max_size"
pub const BACKGROUND: &'static str = "background"
pub const FOREGROUND: &'static str = "foreground"
pub const ROW: &'static str = "row"
pub const COLUMN: &'static str = "column"
pub const VERTICAL_ALIGNMENT: &'static str = "vertical_alignment"
pub const HORIZONTAL_ALIGNMENT: &'static str = "horizontal_alignment"
pub const MARGIN: &'static str = "margin"
pub const VISIBILITY: &'static str = "visibility"
pub const HIT_TEST_VISIBILITY: &'static str = "hit_test_visibility"
pub const Z_INDEX: &'static str = "z_index"
pub const ALLOW_DRAG: &'static str = "allow_drag"
pub const ALLOW_DROP: &'static str = "allow_drop"
pub const DRAW_ON_TOP: &'static str = "draw_on_top"
pub const ENABLED: &'static str = "enabled"
pub const CURSOR: &'static str = "cursor"
pub const OPACITY: &'static str = "opacity"
pub const TOOLTIP: &'static str = "tooltip"
pub const TOOLTIP_TIME: &'static str = "tooltip_time"
pub const CONTEXT_MENU: &'static str = "context_menu"
pub const CLIP_TO_BOUNDS: &'static str = "clip_to_bounds"
pub const ID: &'static str = "id"
sourcepub fn actual_local_size(
&self
) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
pub fn actual_local_size( &self ) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
Returns the actual size of the widget after the full layout cycle.
sourcepub fn actual_initial_size(
&self
) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
pub fn actual_initial_size( &self ) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
Returns size of the widget without any layout or rendering transform applied.
sourcepub fn actual_global_size(
&self
) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
pub fn actual_global_size( &self ) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
Returns the actual global size of the widget after the full layout cycle.
sourcepub fn set_min_size(
&mut self,
value: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
) -> &mut Widget
pub fn set_min_size( &mut self, value: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>> ) -> &mut Widget
Sets the new minimum size of the widget.
sourcepub fn set_min_width(&mut self, value: f32) -> &mut Widget
pub fn set_min_width(&mut self, value: f32) -> &mut Widget
Sets the new minimum width of the widget.
sourcepub fn set_min_height(&mut self, value: f32) -> &mut Widget
pub fn set_min_height(&mut self, value: f32) -> &mut Widget
Sets the new minimum height of the widget.
sourcepub fn min_size(
&self
) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
pub fn min_size( &self ) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
Sets the new minimum size of the widget.
sourcepub fn min_height(&self) -> f32
pub fn min_height(&self) -> f32
Returns the minimum height of the widget.
sourcepub fn is_drag_allowed(&self) -> bool
pub fn is_drag_allowed(&self) -> bool
Return true if the dragging of the widget is allowed, false - otherwise.
sourcepub fn is_drop_allowed(&self) -> bool
pub fn is_drop_allowed(&self) -> bool
Return true if the dropping of other widgets is allowed on this widget, false - otherwise.
sourcepub fn screen_to_local(
&self,
point: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
pub fn screen_to_local( &self, point: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>> ) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
Maps the given point from screen to local widget’s coordinates.
sourcepub fn invalidate_layout(&self)
pub fn invalidate_layout(&self)
Invalidates layout of the widget. WARNING: Do not use this method, unless you understand what you’re doing, it will cause new layout pass for this widget which could be quite heavy and doing so on every frame for multiple widgets will cause severe performance issues.
sourcepub fn invalidate_measure(&self)
pub fn invalidate_measure(&self)
Invalidates measurement results of the widget. WARNING: Do not use this method, unless you understand what you’re doing, it will cause new measurement pass for this widget which could be quite heavy and doing so on every frame for multiple widgets will cause severe performance issues.
sourcepub fn invalidate_arrange(&self)
pub fn invalidate_arrange(&self)
Invalidates arrangement results of the widget. WARNING: Do not use this method, unless you understand what you’re doing, it will cause new arrangement pass for this widget which could be quite heavy and doing so on every frame for multiple widgets will cause severe performance issues.
sourcepub fn is_hit_test_visible(&self) -> bool
pub fn is_hit_test_visible(&self) -> bool
Returns true if the widget is able to participate in hit testing, false - otherwise.
sourcepub fn set_max_size(
&mut self,
value: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
) -> &mut Widget
pub fn set_max_size( &mut self, value: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>> ) -> &mut Widget
Sets the new maximum size of the widget.
sourcepub fn max_size(
&self
) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
pub fn max_size( &self ) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
Returns current maximum size of the widget.
sourcepub fn max_height(&self) -> f32
pub fn max_height(&self) -> f32
Return maximum height of the widget.
sourcepub fn set_z_index(&mut self, z_index: usize) -> &mut Widget
pub fn set_z_index(&mut self, z_index: usize) -> &mut Widget
Sets new Z index for the widget. Z index defines the sorting (stable) index which will be used to “arrange” widgets in the correct order.
sourcepub fn set_background(&mut self, brush: Brush) -> &mut Widget
pub fn set_background(&mut self, brush: Brush) -> &mut Widget
Sets the new background of the widget.
sourcepub fn background(&self) -> Brush
pub fn background(&self) -> Brush
Returns current background of the widget.
sourcepub fn set_foreground(&mut self, brush: Brush) -> &mut Widget
pub fn set_foreground(&mut self, brush: Brush) -> &mut Widget
Sets new foreground of the widget.
sourcepub fn foreground(&self) -> Brush
pub fn foreground(&self) -> Brush
Returns current foreground of the widget.
sourcepub fn is_draw_on_top(&self) -> bool
pub fn is_draw_on_top(&self) -> bool
Return true if the widget is set to be drawn on top of every other, normally drawn, widgets, false - otherwise.
sourcepub fn set_height(&mut self, height: f32) -> &mut Widget
pub fn set_height(&mut self, height: f32) -> &mut Widget
Sets new height of the widget.
sourcepub fn set_desired_local_position(
&mut self,
pos: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
) -> &mut Widget
pub fn set_desired_local_position( &mut self, pos: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>> ) -> &mut Widget
Sets the desired local position of the widget.
sourcepub fn screen_position(
&self
) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
pub fn screen_position( &self ) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
Returns current screen-space position of the widget.
sourcepub fn children(&self) -> &[Handle<UiNode>]
pub fn children(&self) -> &[Handle<UiNode>]
Returns a reference to the slice with the children widgets of this widget.
sourcepub fn set_column(&mut self, column: usize) -> &mut Widget
pub fn set_column(&mut self, column: usize) -> &mut Widget
Sets new column of the widget. Columns are used only by crate::grid::Grid widget.
sourcepub fn column(&self) -> usize
pub fn column(&self) -> usize
Returns current column of the widget. Columns are used only by crate::grid::Grid widget.
sourcepub fn set_row(&mut self, row: usize) -> &mut Widget
pub fn set_row(&mut self, row: usize) -> &mut Widget
Sets new row of the widget. Rows are used only by crate::grid::Grid widget.
sourcepub fn row(&self) -> usize
pub fn row(&self) -> usize
Returns current row of the widget. Rows are used only by crate::grid::Grid widget.
sourcepub fn desired_size(
&self
) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
pub fn desired_size( &self ) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
Returns the desired size of the widget.
sourcepub fn desired_local_position(
&self
) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
pub fn desired_local_position( &self ) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
Returns current desired local position of the widget.
sourcepub fn screen_bounds(&self) -> Rect<f32>
pub fn screen_bounds(&self) -> Rect<f32>
Returns current screen-space bounds of the widget.
sourcepub fn bounding_rect(&self) -> Rect<f32>
pub fn bounding_rect(&self) -> Rect<f32>
Returns local-space bounding rect of the widget.
sourcepub fn visual_transform(
&self
) -> &Matrix<f32, Const<3>, Const<3>, ArrayStorage<f32, 3, 3>>
pub fn visual_transform( &self ) -> &Matrix<f32, Const<3>, Const<3>, ArrayStorage<f32, 3, 3>>
Returns current visual transform of the widget.
sourcepub fn render_transform(
&self
) -> &Matrix<f32, Const<3>, Const<3>, ArrayStorage<f32, 3, 3>>
pub fn render_transform( &self ) -> &Matrix<f32, Const<3>, Const<3>, ArrayStorage<f32, 3, 3>>
Returns current render transform of the widget.
sourcepub fn layout_transform(
&self
) -> &Matrix<f32, Const<3>, Const<3>, ArrayStorage<f32, 3, 3>>
pub fn layout_transform( &self ) -> &Matrix<f32, Const<3>, Const<3>, ArrayStorage<f32, 3, 3>>
Returns current layout transform of the widget.
sourcepub fn has_descendant(
&self,
node_handle: Handle<UiNode>,
ui: &UserInterface
) -> bool
pub fn has_descendant( &self, node_handle: Handle<UiNode>, ui: &UserInterface ) -> bool
Returns true, if the widget has a descendant widget with the specified handle, false - otherwise.
sourcepub fn find_by_criteria_up<Func>(
&self,
ui: &UserInterface,
func: Func
) -> Handle<UiNode>
pub fn find_by_criteria_up<Func>( &self, ui: &UserInterface, func: Func ) -> Handle<UiNode>
Searches a node up on tree starting from the given root that matches a criteria defined by the given func.
sourcepub fn handle_routed_message(
&mut self,
_ui: &mut UserInterface,
msg: &mut UiMessage
)
pub fn handle_routed_message( &mut self, _ui: &mut UserInterface, msg: &mut UiMessage )
Handles incoming WidgetMessages. This method must be called in crate::control::Control::handle_routed_message
of any derived widgets!
sourcepub fn set_vertical_alignment(
&mut self,
vertical_alignment: VerticalAlignment
) -> &mut Widget
pub fn set_vertical_alignment( &mut self, vertical_alignment: VerticalAlignment ) -> &mut Widget
Sets new vertical alignment of the widget.
sourcepub fn vertical_alignment(&self) -> VerticalAlignment
pub fn vertical_alignment(&self) -> VerticalAlignment
Returns current vertical alignment of the widget.
sourcepub fn set_horizontal_alignment(
&mut self,
horizontal_alignment: HorizontalAlignment
) -> &mut Widget
pub fn set_horizontal_alignment( &mut self, horizontal_alignment: HorizontalAlignment ) -> &mut Widget
Sets new horizontal alignment of the widget.
sourcepub fn horizontal_alignment(&self) -> HorizontalAlignment
pub fn horizontal_alignment(&self) -> HorizontalAlignment
Returns current horizontal alignment of the widget.
sourcepub fn set_margin(&mut self, margin: Thickness) -> &mut Widget
pub fn set_margin(&mut self, margin: Thickness) -> &mut Widget
Sets new margin of the widget.
sourcepub fn measure_override(
&self,
ui: &UserInterface,
available_size: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
pub fn measure_override( &self, ui: &UserInterface, available_size: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>> ) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
Performs standard measurement of children nodes. It provides available size as a constraint and returns the maximum desired size across all children. As a result, this widget will have this size as its desired size to fit all the children nodes.
sourcepub fn arrange_override(
&self,
ui: &UserInterface,
final_size: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
pub fn arrange_override( &self, ui: &UserInterface, final_size: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>> ) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
Performs standard arrangement of the children nodes of the widget. It uses input final size to make a final bounding rectangle to arrange children. As a result, all the children nodes will be located at the top-left corner of this widget and stretched to fit its bounds.
sourcepub fn is_arrange_valid(&self) -> bool
pub fn is_arrange_valid(&self) -> bool
Returns true if the current results of arrangement of the widget are valid, false - otherwise.
sourcepub fn is_measure_valid(&self) -> bool
pub fn is_measure_valid(&self) -> bool
Returns true if the current results of measurement of the widget are valid, false - otherwise.
sourcepub fn actual_local_position(
&self
) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
pub fn actual_local_position( &self ) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
Returns current actual local position of the widget. It is valid only after layout pass!
sourcepub fn center(&self) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
pub fn center(&self) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
Returns center point of the widget. It is valid only after layout pass!
sourcepub fn is_globally_visible(&self) -> bool
pub fn is_globally_visible(&self) -> bool
Returns true of the widget is globally visible, which means that all its parents are visible as well
as this widget. It is valid only after the first update of the layout, otherwise if will be always false.
sourcepub fn set_visibility(&mut self, visibility: bool) -> &mut Widget
pub fn set_visibility(&mut self, visibility: bool) -> &mut Widget
Sets new visibility of the widget.
sourcepub fn request_update_visibility(&self)
pub fn request_update_visibility(&self)
Requests (via event queue, so the request is deferred) the update of the visibility of the widget.
sourcepub fn visibility(&self) -> bool
pub fn visibility(&self) -> bool
Returns current visibility of the widget.
sourcepub fn set_enabled(&mut self, enabled: bool) -> &mut Widget
pub fn set_enabled(&mut self, enabled: bool) -> &mut Widget
Enables or disables the widget. Disabled widgets does not interact with user and usually greyed out.
sourcepub fn set_cursor(&mut self, cursor: Option<CursorIcon>)
pub fn set_cursor(&mut self, cursor: Option<CursorIcon>)
Sets new cursor of the widget.
sourcepub fn cursor(&self) -> Option<CursorIcon>
pub fn cursor(&self) -> Option<CursorIcon>
Returns current cursor of the widget.
sourcepub fn user_data_cloned<T>(&self) -> Option<T>where
T: Clone + 'static,
pub fn user_data_cloned<T>(&self) -> Option<T>where
T: Clone + 'static,
Tries to fetch user-defined data of the specified type T.
sourcepub fn clip_bounds(&self) -> Rect<f32>
pub fn clip_bounds(&self) -> Rect<f32>
Returns current clipping bounds of the widget. It is valid only after at least one layout pass.
sourcepub fn set_opacity(&mut self, opacity: Option<f32>) -> &mut Widget
pub fn set_opacity(&mut self, opacity: Option<f32>) -> &mut Widget
Set new opacity of the widget. Opacity should be in [0.0..1.0] range.
sourcepub fn tooltip(&self) -> Option<RcUiNodeHandle>
pub fn tooltip(&self) -> Option<RcUiNodeHandle>
Returns current tooltip handle of the widget.
sourcepub fn set_tooltip(&mut self, tooltip: Option<RcUiNodeHandle>) -> &mut Widget
pub fn set_tooltip(&mut self, tooltip: Option<RcUiNodeHandle>) -> &mut Widget
Sets new tooltip handle of the widget (if any).
sourcepub fn tooltip_time(&self) -> f32
pub fn tooltip_time(&self) -> f32
Returns maximum available time to show the tooltip after the cursor was moved away from the widget.
sourcepub fn set_tooltip_time(&mut self, tooltip_time: f32) -> &mut Widget
pub fn set_tooltip_time(&mut self, tooltip_time: f32) -> &mut Widget
Set the maximum available time to show the tooltip after the cursor was moved away from the widget.
Returns current context menu of the widget.
The context menu receives PopupMessages for being displayed, and so should support those.
Trait Implementations§
source§impl ComponentProvider for Tree
impl ComponentProvider for Tree
source§impl Control for Tree
impl Control for Tree
source§fn resolve(&mut self, node_map: &NodeHandleMapping)
fn resolve(&mut self, node_map: &NodeHandleMapping)
source§fn arrange_override(
&self,
ui: &UserInterface,
final_size: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
fn arrange_override( &self, ui: &UserInterface, final_size: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>> ) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
source§fn handle_routed_message(
&mut self,
ui: &mut UserInterface,
message: &mut UiMessage
)
fn handle_routed_message( &mut self, ui: &mut UserInterface, message: &mut UiMessage )
source§fn on_remove(&self, sender: &Sender<UiMessage>)
fn on_remove(&self, sender: &Sender<UiMessage>)
crate::widget::WidgetMessage::remove.source§fn measure_override(
&self,
ui: &UserInterface,
available_size: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
fn measure_override( &self, ui: &UserInterface, available_size: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>> ) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
source§fn draw(&self, drawing_context: &mut DrawingContext)
fn draw(&self, drawing_context: &mut DrawingContext)
source§fn update(
&mut self,
dt: f32,
sender: &Sender<UiMessage>,
screen_size: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>
)
fn update( &mut self, dt: f32, sender: &Sender<UiMessage>, screen_size: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>> )
source§fn preview_message(&self, ui: &UserInterface, message: &mut UiMessage)
fn preview_message(&self, ui: &UserInterface, message: &mut UiMessage)
preview_message used in a dropdown list:
dropdown list has two separate parts - a field with selected value and a popup for all possible
options. Visual parent of the popup in this case is the root canvas, but logical parent is the
dropdown list. Because of this fact, the field won’t receive any messages from popup, to solve
this we use preview_message. This method is much more restrictive - it does not allow you to
modify a node and ui, you can either request changes by sending a message or use internal
mutability (Cell, RefCell, etc). Read moresource§fn handle_os_event(
&mut self,
self_handle: Handle<UiNode>,
ui: &mut UserInterface,
event: &OsEvent
)
fn handle_os_event( &mut self, self_handle: Handle<UiNode>, ui: &mut UserInterface, event: &OsEvent )
handle_message because os events
are not dispatched - they’ll be passed to this method in any case. Read moresource§impl Reflect for Tree
impl Reflect for Tree
fn type_name(&self) -> &'static str
fn doc(&self) -> &'static str
fn fields_info(&self, func: &mut dyn FnMut(&[FieldInfo<'_, '_>]))
fn into_any(self: Box<Tree>) -> Box<dyn Any>
fn set( &mut self, value: Box<dyn Reflect> ) -> Result<Box<dyn Reflect>, Box<dyn Reflect>>
fn as_any(&self, func: &mut dyn FnMut(&(dyn Any + 'static)))
fn as_any_mut(&mut self, func: &mut dyn FnMut(&mut (dyn Any + 'static)))
fn as_reflect(&self, func: &mut dyn FnMut(&(dyn Reflect + 'static)))
fn as_reflect_mut(&mut self, func: &mut dyn FnMut(&mut (dyn Reflect + 'static)))
fn fields(&self, func: &mut dyn FnMut(&[&(dyn Reflect + 'static)]))
fn fields_mut( &mut self, func: &mut dyn FnMut(&mut [&mut (dyn Reflect + 'static)]) )
fn field( &self, name: &str, func: &mut dyn FnMut(Option<&(dyn Reflect + 'static)>) )
fn field_mut( &mut self, name: &str, func: &mut dyn FnMut(Option<&mut (dyn Reflect + 'static)>) )
source§fn set_field(
&mut self,
field: &str,
value: Box<dyn Reflect>,
func: &mut dyn FnMut(Result<Box<dyn Reflect>, Box<dyn Reflect>>)
)
fn set_field( &mut self, field: &str, value: Box<dyn Reflect>, func: &mut dyn FnMut(Result<Box<dyn Reflect>, Box<dyn Reflect>>) )
#[reflect(setter = ..)] or falls back to
Reflect::field_mutfn as_array(&self, func: &mut dyn FnMut(Option<&(dyn ReflectArray + 'static)>))
fn as_array_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectArray + 'static)>) )
fn as_list(&self, func: &mut dyn FnMut(Option<&(dyn ReflectList + 'static)>))
fn as_list_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectList + 'static)>) )
fn as_inheritable_variable( &self, func: &mut dyn FnMut(Option<&(dyn ReflectInheritableVariable + 'static)>) )
fn as_inheritable_variable_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectInheritableVariable + 'static)>) )
fn as_hash_map( &self, func: &mut dyn FnMut(Option<&(dyn ReflectHashMap + 'static)>) )
fn as_hash_map_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectHashMap + 'static)>) )
Auto Trait Implementations§
impl !RefUnwindSafe for Tree
impl Send for Tree
impl !Sync for Tree
impl Unpin for Tree
impl !UnwindSafe for Tree
Blanket Implementations§
source§impl<T> BaseControl for T
impl<T> BaseControl for T
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.source§impl<T> FieldValue for Twhere
T: 'static,
impl<T> FieldValue for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> ResolvePath for Twhere
T: Reflect,
impl<T> ResolvePath for Twhere
T: Reflect,
fn resolve_path<'p>( &self, path: &'p str, func: &mut dyn FnMut(Result<&(dyn Reflect + 'static), ReflectPathError<'p>>) )
fn resolve_path_mut<'p>( &mut self, path: &'p str, func: &mut dyn FnMut(Result<&mut (dyn Reflect + 'static), ReflectPathError<'p>>) )
fn get_resolve_path<T, 'p>(
&self,
path: &'p str,
func: &mut dyn FnMut(Result<&T, ReflectPathError<'p>>)
)where
T: Reflect,
fn get_resolve_path_mut<T, 'p>(
&mut self,
path: &'p str,
func: &mut dyn FnMut(Result<&mut T, ReflectPathError<'p>>)
)where
T: Reflect,
source§impl<T> ScriptMessagePayload for T
impl<T> ScriptMessagePayload for T
source§fn as_any_ref(&self) -> &(dyn Any + 'static)
fn as_any_ref(&self) -> &(dyn Any + 'static)
self as &dyn Anysource§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
self as &dyn Any§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.