Struct Widget

Source
pub struct Widget {
Show 57 fields pub handle: Handle<UiNode>, pub name: ImmutableString, pub desired_local_position: InheritableVariable<Vector2<f32>>, pub width: InheritableVariable<f32>, pub height: InheritableVariable<f32>, pub min_size: InheritableVariable<Vector2<f32>>, pub max_size: InheritableVariable<Vector2<f32>>, pub background: InheritableVariable<StyledProperty<Brush>>, pub foreground: InheritableVariable<StyledProperty<Brush>>, pub row: InheritableVariable<usize>, pub column: InheritableVariable<usize>, pub vertical_alignment: InheritableVariable<VerticalAlignment>, pub horizontal_alignment: InheritableVariable<HorizontalAlignment>, pub margin: InheritableVariable<Thickness>, pub visibility: InheritableVariable<bool>, pub global_visibility: bool, pub children: Vec<Handle<UiNode>>, pub parent: Handle<UiNode>, pub command_indices: RefCell<Vec<usize>>, pub is_mouse_directly_over: bool, pub hit_test_visibility: InheritableVariable<bool>, pub z_index: InheritableVariable<usize>, pub allow_drag: InheritableVariable<bool>, pub allow_drop: InheritableVariable<bool>, pub user_data: Option<Arc<Mutex<dyn Any + Send>>>, pub draw_on_top: InheritableVariable<bool>, pub enabled: InheritableVariable<bool>, pub cursor: InheritableVariable<Option<CursorIcon>>, pub opacity: InheritableVariable<Option<f32>>, pub tooltip: Option<RcUiNodeHandle>, pub tooltip_time: f32, pub context_menu: Option<RcUiNodeHandle>, pub clip_to_bounds: InheritableVariable<bool>, pub layout_transform: Matrix3<f32>, pub render_transform: Matrix3<f32>, pub visual_transform: Matrix3<f32>, pub preview_messages: bool, pub handle_os_events: bool, pub tab_index: InheritableVariable<Option<usize>>, pub tab_stop: InheritableVariable<bool>, pub need_update: bool, pub ignore_layout_rounding: bool, pub accepts_input: bool, pub layout_events_sender: Option<Sender<LayoutEvent>>, pub id: Uuid, pub is_resource_instance_root: bool, pub resource: Option<Resource<UserInterface>>, pub original_handle_in_resource: Handle<UiNode>, pub measure_valid: Cell<bool>, pub arrange_valid: Cell<bool>, pub prev_measure: Cell<Vector2<f32>>, pub prev_arrange: Cell<Rect<f32>>, pub desired_size: Cell<Vector2<f32>>, pub actual_local_position: Cell<Vector2<f32>>, pub actual_local_size: Cell<Vector2<f32>>, pub prev_global_visibility: bool, pub clip_bounds: Cell<Rect<f32>>,
}
Expand description

Widget is a base UI element, that is always used to build derived, more complex, widgets. In general, it is a container for layout information, basic visual appearance, visibility options, parent-child information. It does almost nothing on its own, instead, the user interface modifies its state accordingly.

Fields§

§handle: Handle<UiNode>

Self handle of the widget. It is valid only, if the widget is added to the user interface, in other cases it will most likely be Handle::NONE.

§name: ImmutableString

Name of the widget. Could be useful for debugging purposes.

§desired_local_position: InheritableVariable<Vector2<f32>>

Desired position relative to the parent node. It is just a recommendation for the layout system, actual position will be stored in the actual_local_position field and can be fetched using Widget::actual_local_position method.

§width: InheritableVariable<f32>

Explicit width for the widget, or automatic if f32::NAN (means the value is undefined). Default is f32::NAN.

§height: InheritableVariable<f32>

Explicit height for the widget, or automatic if f32::NAN (means the value is undefined). Default is f32::NAN.

§min_size: InheritableVariable<Vector2<f32>>

Minimum width and height. Default is 0.0 for both axes.

§max_size: InheritableVariable<Vector2<f32>>

Maximum width and height. Default is f32::INFINITY for both axes.

§background: InheritableVariable<StyledProperty<Brush>>

Background brush of the widget.

§foreground: InheritableVariable<StyledProperty<Brush>>

Foreground brush of the widget.

§row: InheritableVariable<usize>

Index of the row to which this widget belongs to. It is valid only in when used in crate::grid::Grid widget.

§column: InheritableVariable<usize>

Index of the column to which this widget belongs to. It is valid only in when used in crate::grid::Grid widget.

§vertical_alignment: InheritableVariable<VerticalAlignment>

Vertical alignment of the widget.

§horizontal_alignment: InheritableVariable<HorizontalAlignment>

Horizontal alignment of the widget.

§margin: InheritableVariable<Thickness>

Margin for every sides of bounding rectangle. See Thickness docs for more info.

§visibility: InheritableVariable<bool>

Current, local, visibility state of the widget.

§global_visibility: bool

Current, global (including the chain of parent widgets), visibility state of the widget.

§children: Vec<Handle<UiNode>>

A set of handles to children nodes of this widget.

§parent: Handle<UiNode>

A handle to the parent node of this widget.

§command_indices: RefCell<Vec<usize>>

Indices of drawing commands in the drawing context emitted by this widget. It is used for picking.

§is_mouse_directly_over: bool

A flag, that indicates that the mouse is directly over the widget. It will be raised only for top-most widget in the “stack” of widgets.

§hit_test_visibility: InheritableVariable<bool>

A flag, that defines whether the widget is “visible” for hit testing (picking). Could be useful to prevent some widgets from any interactions with mouse.

§z_index: InheritableVariable<usize>

Index of the widget in parent’s children list that defines its order in drawing and picking.

§allow_drag: InheritableVariable<bool>

A flag, that defines whether the drag from drag’n’drop functionality can be started by the widget or not.

§allow_drop: InheritableVariable<bool>

A flag, that defines whether the drop from drag’n’drop functionality can be accepted by the widget or not.

§user_data: Option<Arc<Mutex<dyn Any + Send>>>

Optional, user-defined data.

§draw_on_top: InheritableVariable<bool>

A flag, that defines whether the widget should be drawn in a separate drawind pass after any other widget that draws normally.

§enabled: InheritableVariable<bool>

A flag, that defines whether the widget is enabled or not. Disabled widgets cannot be interacted by used and they’re greyed out.

§cursor: InheritableVariable<Option<CursorIcon>>

Optional cursor icon that will be used for mouse cursor when hovering over the widget.

§opacity: InheritableVariable<Option<f32>>

Optional opacity of the widget. It should be in [0.0..1.0] range, where 0.0 - fully transparent, 1.0 - fully opaque.

§tooltip: Option<RcUiNodeHandle>

An optional ref counted handle to a tooltip used by the widget.

§tooltip_time: f32

Maximum available time to show the tooltip after the cursor was moved away from the widget.

§context_menu: Option<RcUiNodeHandle>

An optional ref counted handle to a context menu used by the widget.

§clip_to_bounds: InheritableVariable<bool>

A flag, that defines whether the widget should be clipped by the parent bounds or not.

§layout_transform: Matrix3<f32>

Current render transform of the node. It modifies layout information of the widget, as well as it affects visual transform of the widget.

§render_transform: Matrix3<f32>

Current render transform of the node. It only modifies the widget at drawing stage, layout information remains unmodified.

§visual_transform: Matrix3<f32>

Current visual transform of the node. It always contains a result of mixing the layout and render transformation matrices. Visual transform could be used to transform a point to screen space. To transform a screen space point to local coordinates use Widget::screen_to_local method.

§preview_messages: bool

A flag, that defines whether the widget will preview UI messages or not. Basically, it defines whether crate::Control::preview_message is called or not.

§handle_os_events: bool

A flag, that defines whether the widget will receive any OS events or not. Basically, it defines whether crate::Control::handle_os_event is called or not.

§tab_index: InheritableVariable<Option<usize>>

Defines the order in which this widget will get keyboard focus when Tab key is pressed. If set to None, Tab key won’t do anything on such widget. Default is None.

§tab_stop: InheritableVariable<bool>

A flag, that defines whether the Tab key navigation is enabled or disabled for this widget.

§need_update: bool

A flag, that defines whether the widget will be update or not. Basically, it defines whether crate::Control::update is called or not.

§ignore_layout_rounding: bool

Enables (false) or disables (true) layout rounding.

§accepts_input: bool

A flag, that indicates that the widget accepts user input. It could be used to determine, if a user can interact with the widget using keyboard. It is also used for automatic assignment of the tab index. Keep in mind, that this flag is only a marker and does not do anything else on its own. Default value is false.

§layout_events_sender: Option<Sender<LayoutEvent>>

Internal sender for layout events.

§id: Uuid

Unique identifier of the widget.

§is_resource_instance_root: bool

A flag, that indicates whether this widget is a root widget of a hierarchy of widgets instantiated from a resource.

§resource: Option<Resource<UserInterface>>

A resource from which this widget was instantiated from, can work in pair with original handle to get a corresponding widget from resource.

§original_handle_in_resource: Handle<UiNode>

Handle to a widget in a user interface resource from which this node was instantiated from.

§measure_valid: Cell<bool>

A flag, that defines whether the measurement results are still valid or not.

§arrange_valid: Cell<bool>

A flag, that defines whether the arrangement results are still valid or not.

§prev_measure: Cell<Vector2<f32>>

Results or previous measurement.

§prev_arrange: Cell<Rect<f32>>

Results or previous arrangement.

§desired_size: Cell<Vector2<f32>>

Desired size of the node after Measure pass.

§actual_local_position: Cell<Vector2<f32>>

Actual local position of the widget after Arrange pass.

§actual_local_size: Cell<Vector2<f32>>

Actual local size of the widget after Arrange pass.

§prev_global_visibility: bool

Previous global visibility of the widget.

§clip_bounds: Cell<Rect<f32>>

Current clip bounds of the widget.

Implementations§

Source§

impl Widget

Source

pub const NAME: &'static str = "name"

Source

pub const DESIRED_LOCAL_POSITION: &'static str = "desired_local_position"

Source

pub const WIDTH: &'static str = "width"

Source

pub const HEIGHT: &'static str = "height"

Source

pub const MIN_SIZE: &'static str = "min_size"

Source

pub const MAX_SIZE: &'static str = "max_size"

Source

pub const BACKGROUND: &'static str = "background"

Source

pub const FOREGROUND: &'static str = "foreground"

Source

pub const ROW: &'static str = "row"

Source

pub const COLUMN: &'static str = "column"

Source

pub const VERTICAL_ALIGNMENT: &'static str = "vertical_alignment"

Source

pub const HORIZONTAL_ALIGNMENT: &'static str = "horizontal_alignment"

Source

pub const MARGIN: &'static str = "margin"

Source

pub const VISIBILITY: &'static str = "visibility"

Source

pub const HIT_TEST_VISIBILITY: &'static str = "hit_test_visibility"

Source

pub const Z_INDEX: &'static str = "z_index"

Source

pub const ALLOW_DRAG: &'static str = "allow_drag"

Source

pub const ALLOW_DROP: &'static str = "allow_drop"

Source

pub const DRAW_ON_TOP: &'static str = "draw_on_top"

Source

pub const ENABLED: &'static str = "enabled"

Source

pub const CURSOR: &'static str = "cursor"

Source

pub const OPACITY: &'static str = "opacity"

Source

pub const TOOLTIP: &'static str = "tooltip"

Source

pub const TOOLTIP_TIME: &'static str = "tooltip_time"

Source

pub const CONTEXT_MENU: &'static str = "context_menu"

Source

pub const CLIP_TO_BOUNDS: &'static str = "clip_to_bounds"

Source

pub const PREVIEW_MESSAGES: &'static str = "preview_messages"

Source

pub const HANDLE_OS_EVENTS: &'static str = "handle_os_events"

Source

pub const TAB_INDEX: &'static str = "tab_index"

Source

pub const TAB_STOP: &'static str = "tab_stop"

Source

pub const NEED_UPDATE: &'static str = "need_update"

Source

pub const IGNORE_LAYOUT_ROUNDING: &'static str = "ignore_layout_rounding"

Source

pub const ACCEPTS_INPUT: &'static str = "accepts_input"

Source

pub const ID: &'static str = "id"

Source

pub const RESOURCE: &'static str = "resource"

Source§

impl Widget

Source

pub fn handle(&self) -> Handle<UiNode>

Returns self handle of the widget.

Source

pub fn name(&self) -> &str

Returns the name of the widget.

Source

pub fn set_name<P: AsRef<str>>(&mut self, name: P) -> &mut Self

Sets the new name of the widget.

Source

pub fn actual_local_size(&self) -> Vector2<f32>

Returns the actual size of the widget after the full layout cycle.

Source

pub fn actual_initial_size(&self) -> Vector2<f32>

Returns size of the widget without any layout or rendering transform applied.

Source

pub fn actual_global_size(&self) -> Vector2<f32>

Returns the actual global size of the widget after the full layout cycle.

Source

pub fn set_min_size(&mut self, value: Vector2<f32>) -> &mut Self

Sets the new minimum size of the widget.

Source

pub fn set_min_width(&mut self, value: f32) -> &mut Self

Sets the new minimum width of the widget.

Source

pub fn set_min_height(&mut self, value: f32) -> &mut Self

Sets the new minimum height of the widget.

Source

pub fn min_size(&self) -> Vector2<f32>

Sets the new minimum size of the widget.

Source

pub fn min_width(&self) -> f32

Returns the minimum width of the widget.

Source

pub fn min_height(&self) -> f32

Returns the minimum height of the widget.

Source

pub fn is_drag_allowed(&self) -> bool

Return true if the dragging of the widget is allowed, false - otherwise.

Source

pub fn is_drop_allowed(&self) -> bool

Return true if the dropping of other widgets is allowed on this widget, false - otherwise.

Source

pub fn screen_to_local(&self, point: Vector2<f32>) -> Vector2<f32>

Maps the given point from screen to local widget’s coordinates. Could be used to transform mouse cursor position (which is in screen space) to local widget coordinates.

Source

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.

Source

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.

Source

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.

Source

pub fn is_hit_test_visible(&self) -> bool

Returns true if the widget is able to participate in hit testing, false - otherwise.

Source

pub fn set_max_size(&mut self, value: Vector2<f32>) -> &mut Self

Sets the new maximum size of the widget.

Source

pub fn max_size(&self) -> Vector2<f32>

Returns current maximum size of the widget.

Source

pub fn max_width(&self) -> f32

Returns maximum width of the widget.

Source

pub fn max_height(&self) -> f32

Return maximum height of the widget.

Source

pub fn set_z_index(&mut self, z_index: usize) -> &mut Self

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.

Source

pub fn z_index(&self) -> usize

Returns current Z index of the widget.

Source

pub fn set_background(&mut self, brush: Brush) -> &mut Self

Sets the new background of the widget.

Source

pub fn background(&self) -> Brush

Returns current background of the widget.

Source

pub fn set_foreground(&mut self, brush: Brush) -> &mut Self

Sets new foreground of the widget.

Source

pub fn foreground(&self) -> Brush

Returns current foreground of the widget.

Source

pub fn set_width(&mut self, width: f32) -> &mut Self

Sets new width of the widget.

Source

pub fn width(&self) -> f32

Returns current width of the widget.

Source

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.

Source

pub fn set_height(&mut self, height: f32) -> &mut Self

Sets new height of the widget.

Source

pub fn height(&self) -> f32

Returns current height of the widget.

Source

pub fn set_desired_local_position(&mut self, pos: Vector2<f32>) -> &mut Self

Sets the desired local position of the widget.

Source

pub fn screen_position(&self) -> Vector2<f32>

Returns current screen-space position of the widget.

Source

pub fn children(&self) -> &[Handle<UiNode>]

Returns a reference to the slice with the children widgets of this widget.

Source

pub fn parent(&self) -> Handle<UiNode>

Returns current parent handle of the widget.

Source

pub fn set_column(&mut self, column: usize) -> &mut Self

Sets new column of the widget. Columns are used only by crate::grid::Grid widget.

Source

pub fn column(&self) -> usize

Returns current column of the widget. Columns are used only by crate::grid::Grid widget.

Source

pub fn set_row(&mut self, row: usize) -> &mut Self

Sets new row of the widget. Rows are used only by crate::grid::Grid widget.

Source

pub fn row(&self) -> usize

Returns current row of the widget. Rows are used only by crate::grid::Grid widget.

Source

pub fn desired_size(&self) -> Vector2<f32>

Returns the desired size of the widget.

Source

pub fn desired_local_position(&self) -> Vector2<f32>

Returns current desired local position of the widget.

Source

pub fn screen_bounds(&self) -> Rect<f32>

Returns current screen-space bounds of the widget.

Source

pub fn bounding_rect(&self) -> Rect<f32>

Returns local-space bounding rect of the widget.

Source

pub fn visual_transform(&self) -> &Matrix3<f32>

Returns current visual transform of the widget.

Source

pub fn visual_scaling(&self) -> Vector2<f32>

Returns scaling along both axes.

Source

pub fn visual_max_scaling(&self) -> f32

Returns max uniform scaling of both axes.

Source

pub fn render_transform(&self) -> &Matrix3<f32>

Returns current render transform of the widget.

Source

pub fn layout_transform(&self) -> &Matrix3<f32>

Returns current layout transform of the widget.

Source

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.

Source

pub fn find_by_criteria_up<Func: Fn(&UiNode) -> bool>( &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.

Source

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!

Source

pub fn set_vertical_alignment( &mut self, vertical_alignment: VerticalAlignment, ) -> &mut Self

Sets new vertical alignment of the widget.

Source

pub fn vertical_alignment(&self) -> VerticalAlignment

Returns current vertical alignment of the widget.

Source

pub fn set_horizontal_alignment( &mut self, horizontal_alignment: HorizontalAlignment, ) -> &mut Self

Sets new horizontal alignment of the widget.

Source

pub fn horizontal_alignment(&self) -> HorizontalAlignment

Returns current horizontal alignment of the widget.

Source

pub fn set_margin(&mut self, margin: Thickness) -> &mut Self

Sets new margin of the widget.

Source

pub fn margin(&self) -> Thickness

Returns current margin of the widget.

Source

pub fn measure_override( &self, ui: &UserInterface, available_size: Vector2<f32>, ) -> Vector2<f32>

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.

Source

pub fn arrange_override( &self, ui: &UserInterface, final_size: Vector2<f32>, ) -> Vector2<f32>

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.

Source

pub fn is_arrange_valid(&self) -> bool

Returns true if the current results of arrangement of the widget are valid, false - otherwise.

Source

pub fn is_measure_valid(&self) -> bool

Returns true if the current results of measurement of the widget are valid, false - otherwise.

Source

pub fn actual_local_position(&self) -> Vector2<f32>

Returns current actual local position of the widget. It is valid only after layout pass!

Source

pub fn center(&self) -> Vector2<f32>

Returns center point of the widget. It is valid only after layout pass!

Source

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.

Source

pub fn set_visibility(&mut self, visibility: bool) -> &mut Self

Sets new visibility of the widget.

Source

pub fn request_update_visibility(&self)

Requests (via event queue, so the request is deferred) the update of the visibility of the widget.

Source

pub fn visibility(&self) -> bool

Returns current visibility of the widget.

Source

pub fn set_enabled(&mut self, enabled: bool) -> &mut Self

Enables or disables the widget. Disabled widgets does not interact with user and usually greyed out.

Source

pub fn enabled(&self) -> bool

Returns true if the widget if enabled, false - otherwise.

Source

pub fn set_cursor(&mut self, cursor: Option<CursorIcon>)

Sets new cursor of the widget.

Source

pub fn cursor(&self) -> Option<CursorIcon>

Returns current cursor of the widget.

Source

pub fn user_data_cloned<T: Clone + 'static>(&self) -> Option<T>

Tries to fetch user-defined data of the specified type T.

Source

pub fn clip_bounds(&self) -> Rect<f32>

Returns current clipping bounds of the widget. It is valid only after at least one layout pass.

Source

pub fn set_opacity(&mut self, opacity: Option<f32>) -> &mut Self

Set new opacity of the widget. Opacity should be in [0.0..1.0] range.

Source

pub fn opacity(&self) -> Option<f32>

Returns current opacity of the widget.

Source

pub fn tooltip(&self) -> Option<RcUiNodeHandle>

Returns current tooltip handle of the widget.

Source

pub fn set_tooltip(&mut self, tooltip: Option<RcUiNodeHandle>) -> &mut Self

Sets new tooltip handle of the widget (if any).

Source

pub fn tooltip_time(&self) -> f32

Returns maximum available time to show the tooltip after the cursor was moved away from the widget.

Source

pub fn set_tooltip_time(&mut self, tooltip_time: f32) -> &mut Self

Set the maximum available time to show the tooltip after the cursor was moved away from the widget.

Source

pub fn context_menu(&self) -> Option<RcUiNodeHandle>

Returns current context menu of the widget.

Source

pub fn set_context_menu( &mut self, context_menu: Option<RcUiNodeHandle>, ) -> &mut Self

The context menu receives PopupMessages for being displayed, and so should support those.

Trait Implementations§

Source§

impl Clone for Widget

Source§

fn clone(&self) -> Widget

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Widget

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Widget

Source§

fn default() -> Widget

Returns the “default value” for a type. Read more
Source§

impl Reflect for Widget

Source§

fn source_path() -> &'static str

Source§

fn type_name(&self) -> &'static str

Source§

fn doc(&self) -> &'static str

Source§

fn assembly_name(&self) -> &'static str

Returns a parent assembly name of the type that implements this trait. WARNING: You should use proc-macro (#[derive(Reflect)]) to ensure that this method will return correct assembly name. In other words - there’s no guarantee, that any implementation other than proc-macro will return a correct name of the assembly. Alternatively, you can use env!("CARGO_PKG_NAME") as an implementation.
Source§

fn type_assembly_name() -> &'static str

Returns a parent assembly name of the type that implements this trait. WARNING: You should use proc-macro (#[derive(Reflect)]) to ensure that this method will return correct assembly name. In other words - there’s no guarantee, that any implementation other than proc-macro will return a correct name of the assembly. Alternatively, you can use env!("CARGO_PKG_NAME") as an implementation.
Source§

fn fields_info(&self, func: &mut dyn FnMut(&[FieldInfo<'_, '_>]))

Source§

fn into_any(self: Box<Self>) -> Box<dyn Any>

Source§

fn set( &mut self, value: Box<dyn Reflect>, ) -> Result<Box<dyn Reflect>, Box<dyn Reflect>>

Source§

fn set_field( &mut self, name: &str, value: Box<dyn Reflect>, func: &mut dyn FnMut(Result<Box<dyn Reflect>, Box<dyn Reflect>>), )

Calls user method specified with #[reflect(setter = ..)] or falls back to Reflect::field_mut
Source§

fn as_any(&self, func: &mut dyn FnMut(&dyn Any))

Source§

fn as_any_mut(&mut self, func: &mut dyn FnMut(&mut dyn Any))

Source§

fn as_reflect(&self, func: &mut dyn FnMut(&dyn Reflect))

Source§

fn as_reflect_mut(&mut self, func: &mut dyn FnMut(&mut dyn Reflect))

Source§

fn fields(&self, func: &mut dyn FnMut(&[&dyn Reflect]))

Source§

fn fields_mut(&mut self, func: &mut dyn FnMut(&mut [&mut dyn Reflect]))

Source§

fn field(&self, name: &str, func: &mut dyn FnMut(Option<&dyn Reflect>))

Source§

fn field_mut( &mut self, name: &str, func: &mut dyn FnMut(Option<&mut dyn Reflect>), )

Source§

fn as_array(&self, func: &mut dyn FnMut(Option<&(dyn ReflectArray + 'static)>))

Source§

fn as_array_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectArray + 'static)>), )

Source§

fn as_list(&self, func: &mut dyn FnMut(Option<&(dyn ReflectList + 'static)>))

Source§

fn as_list_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectList + 'static)>), )

Source§

fn as_inheritable_variable( &self, func: &mut dyn FnMut(Option<&(dyn ReflectInheritableVariable + 'static)>), )

Source§

fn as_inheritable_variable_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectInheritableVariable + 'static)>), )

Source§

fn as_hash_map( &self, func: &mut dyn FnMut(Option<&(dyn ReflectHashMap + 'static)>), )

Source§

fn as_hash_map_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectHashMap + 'static)>), )

Source§

impl Visit for Widget

Source§

fn visit(&mut self, name: &str, visitor: &mut Visitor) -> VisitResult

Read or write this value, depending on whether Visitor::is_reading() is true or false. Read more

Auto Trait Implementations§

§

impl !Freeze for Widget

§

impl !RefUnwindSafe for Widget

§

impl Send for Widget

§

impl !Sync for Widget

§

impl Unpin for Widget

§

impl !UnwindSafe for Widget

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsyncTaskResult for T
where T: Any + Send + 'static,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &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> Downcast for T
where T: Any,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts self reference as a reference to Any. Could be used to downcast a trait object to a particular type.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts self reference as a reference to Any. Could be used to downcast a trait object to a particular type.
Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Source§

impl<T> FieldValue for T
where T: 'static,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Casts self to a &dyn Any
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<R> GetField for R
where R: Reflect,

Source§

fn get_field<T>(&self, name: &str, func: &mut dyn FnMut(Option<&T>))
where T: 'static,

Source§

fn get_field_mut<T>(&mut self, name: &str, func: &mut dyn FnMut(Option<&mut T>))
where T: 'static,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ReflectBase for T
where T: Reflect,

Source§

fn as_any_raw(&self) -> &(dyn Any + 'static)

Source§

fn as_any_raw_mut(&mut self) -> &mut (dyn Any + 'static)

Source§

impl<T> ResolvePath for T
where T: Reflect,

Source§

fn resolve_path<'p>( &self, path: &'p str, func: &mut dyn FnMut(Result<&(dyn Reflect + 'static), ReflectPathError<'p>>), )

Source§

fn resolve_path_mut<'p>( &mut self, path: &'p str, func: &mut dyn FnMut(Result<&mut (dyn Reflect + 'static), ReflectPathError<'p>>), )

Source§

fn get_resolve_path<'p, T>( &self, path: &'p str, func: &mut dyn FnMut(Result<&T, ReflectPathError<'p>>), )
where T: Reflect,

Source§

fn get_resolve_path_mut<'p, T>( &mut self, path: &'p str, func: &mut dyn FnMut(Result<&mut T, ReflectPathError<'p>>), )
where T: Reflect,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Value for T
where T: Reflect + Clone + Debug + Send,

Source§

fn clone_box(&self) -> Box<dyn Value>

Source§

fn into_box_reflect(self: Box<T>) -> Box<dyn Reflect>

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more