pub struct UserInterface {
pub style: StyleResource,
pub default_font: FontResource,
pub double_click_time_slice: f32,
pub tooltip_appear_delay: f32,
/* private fields */
}
Fields§
§style: StyleResource
§default_font: FontResource
§double_click_time_slice: f32
§tooltip_appear_delay: f32
Implementations§
Source§impl UserInterface
impl UserInterface
pub const SCREEN_SIZE: &'static str = "screen_size"
pub const NODES: &'static str = "nodes"
pub const VISUAL_DEBUG: &'static str = "visual_debug"
pub const ROOT_CANVAS: &'static str = "root_canvas"
pub const PICKED_NODE: &'static str = "picked_node"
pub const PREV_PICKED_NODE: &'static str = "prev_picked_node"
pub const CAPTURED_NODE: &'static str = "captured_node"
pub const KEYBOARD_FOCUS_NODE: &'static str = "keyboard_focus_node"
pub const CURSOR_POSITION: &'static str = "cursor_position"
pub const STYLE: &'static str = "style"
pub const STACK: &'static str = "stack"
pub const PICKING_STACK: &'static str = "picking_stack"
pub const DRAG_CONTEXT: &'static str = "drag_context"
pub const MOUSE_STATE: &'static str = "mouse_state"
pub const KEYBOARD_MODIFIERS: &'static str = "keyboard_modifiers"
pub const CURSOR_ICON: &'static str = "cursor_icon"
pub const NEED_UPDATE_GLOBAL_TRANSFORM: &'static str = "need_update_global_transform"
pub const DOUBLE_CLICK_TIME_SLICE: &'static str = "double_click_time_slice"
pub const TOOLTIP_APPEAR_DELAY: &'static str = "tooltip_appear_delay"
Source§impl UserInterface
impl UserInterface
pub fn new(screen_size: Vector2<f32>) -> UserInterface
pub fn new_with_channel( sender: Sender<UiMessage>, receiver: Receiver<UiMessage>, screen_size: Vector2<f32>, ) -> UserInterface
pub fn set_tooltip_appear_delay(&mut self, appear_delay: f32)
pub fn tooltip_appear_delay(&self) -> f32
pub fn active_tooltip(&self) -> Option<&TooltipEntry>
pub fn keyboard_modifiers(&self) -> KeyboardModifiers
pub fn build_ctx(&mut self) -> BuildContext<'_>
pub fn capture_mouse(&mut self, node: Handle<UiNode>) -> bool
pub fn release_mouse_capture(&mut self)
pub fn get_drawing_context(&self) -> &DrawingContext
pub fn get_drawing_context_mut(&mut self) -> &mut DrawingContext
pub fn is_node_enabled(&self, handle: Handle<UiNode>) -> bool
pub fn screen_size(&self) -> Vector2<f32>
pub fn set_screen_size(&mut self, screen_size: Vector2<f32>)
pub fn invalidate_layout(&mut self)
pub fn update_layout(&mut self, screen_size: Vector2<f32>)
pub fn update( &mut self, screen_size: Vector2<f32>, dt: f32, switches: &UiUpdateSwitches, )
pub fn style(&self) -> &StyleResource
pub fn set_style(&mut self, style: StyleResource)
pub fn cursor(&self) -> CursorIcon
pub fn set_time(&mut self, elapsed_time: f32)
pub fn draw(&mut self) -> &DrawingContext
pub fn clipboard(&self) -> Option<Ref<'_, ClipboardContext>>
pub fn clipboard_mut(&self) -> Option<RefMut<'_, ClipboardContext>>
pub fn arrange_node( &self, handle: Handle<UiNode>, final_rect: &Rect<f32>, ) -> bool
pub fn measure_node( &self, handle: Handle<UiNode>, available_size: Vector2<f32>, ) -> bool
Sourcepub fn cursor_position(&self) -> Vector2<f32>
pub fn cursor_position(&self) -> Vector2<f32>
Cursor position in screen space coordinate system.
pub fn hit_test_unrestricted(&self, pt: Vector2<f32>) -> Handle<UiNode>
pub fn hit_test(&self, pt: Vector2<f32>) -> Handle<UiNode>
Sourcepub fn is_node_child_of(
&self,
node_handle: Handle<UiNode>,
root_handle: Handle<UiNode>,
) -> bool
pub fn is_node_child_of( &self, node_handle: Handle<UiNode>, root_handle: Handle<UiNode>, ) -> bool
Checks if specified node is a child of some other node on root_handle
. This method
is useful to understand if some event came from some node down by tree.
Sourcepub fn sender(&self) -> Sender<UiMessage>
pub fn sender(&self) -> Sender<UiMessage>
Returns instance of message sender which can be used to push messages into queue from other threads.
pub fn send_message(&self, message: UiMessage)
Sourcepub fn poll_message(&mut self) -> Option<UiMessage>
pub fn poll_message(&mut self) -> Option<UiMessage>
Extracts UI event one-by-one from common queue. Each extracted event will go to all available nodes first and only then will be moved outside of this method. This is one of most important methods which must be called each frame of your game loop, otherwise UI will not respond to any kind of events and simply speaking will just not work.
pub fn screen_to_root_canvas_space( &self, position: Vector2<f32>, ) -> Vector2<f32>
pub fn captured_node(&self) -> Handle<UiNode>
Sourcepub fn process_os_event(&mut self, event: &OsEvent) -> bool
pub fn process_os_event(&mut self, event: &OsEvent) -> bool
Translates raw window event into some specific UI message. This is one of the most important methods of UI. You must call it each time you received a message from a window.
pub fn nodes(&self) -> &Pool<UiNode, WidgetContainer>
pub fn root(&self) -> Handle<UiNode>
Sourcepub fn take_reserve(
&mut self,
handle: Handle<UiNode>,
) -> (Ticket<UiNode>, UiNode)
pub fn take_reserve( &mut self, handle: Handle<UiNode>, ) -> (Ticket<UiNode>, UiNode)
Extracts a widget from the user interface and reserves its handle. It is used to temporarily take ownership over the widget, and then put the widget back using the returned ticket. Extracted widget is detached from its parent!
Sourcepub fn put_back(
&mut self,
ticket: Ticket<UiNode>,
node: UiNode,
) -> Handle<UiNode>
pub fn put_back( &mut self, ticket: Ticket<UiNode>, node: UiNode, ) -> Handle<UiNode>
Puts the widget back by the given ticket. Attaches it back to the root canvas of the user interface.
Sourcepub fn forget_ticket(&mut self, ticket: Ticket<UiNode>, node: UiNode) -> UiNode
pub fn forget_ticket(&mut self, ticket: Ticket<UiNode>, node: UiNode) -> UiNode
Makes a widget handle vacant again.
Sourcepub fn take_reserve_sub_graph(&mut self, root: Handle<UiNode>) -> SubGraph
pub fn take_reserve_sub_graph(&mut self, root: Handle<UiNode>) -> SubGraph
Extracts sub-graph starting from the given widget. All handles to extracted widgets becomes reserved and will be marked as “occupied”, an attempt to borrow a widget at such handle will result in panic!. Please note that root widget will be detached from its parent!
Sourcepub fn put_sub_graph_back(&mut self, sub_graph: SubGraph) -> Handle<UiNode>
pub fn put_sub_graph_back(&mut self, sub_graph: SubGraph) -> Handle<UiNode>
Puts previously extracted sub-graph into the user interface. Handles to widgets will become valid again. After that you probably want to re-link returned handle with its previous parent.
Sourcepub fn forget_sub_graph(&mut self, sub_graph: SubGraph)
pub fn forget_sub_graph(&mut self, sub_graph: SubGraph)
Forgets the entire sub-graph making handles to widgets invalid.
pub fn push_picking_restriction(&mut self, restriction: RestrictionEntry)
pub fn remove_picking_restriction(&mut self, node: Handle<UiNode>)
pub fn picking_restriction_stack(&self) -> &[RestrictionEntry]
Sourcepub fn drop_picking_restrictions(&mut self)
pub fn drop_picking_restrictions(&mut self)
Removes all picking restrictions.
pub fn top_picking_restriction(&self) -> Option<RestrictionEntry>
pub fn drag_context(&self) -> &DragContext
Sourcepub fn link_nodes(
&mut self,
child_handle: Handle<UiNode>,
parent_handle: Handle<UiNode>,
in_front: bool,
)
pub fn link_nodes( &mut self, child_handle: Handle<UiNode>, parent_handle: Handle<UiNode>, in_front: bool, )
Links the specified child widget with the specified parent widget.
pub fn node_mut(&mut self, node_handle: Handle<UiNode>) -> &mut UiNode
pub fn try_get_node_mut( &mut self, node_handle: Handle<UiNode>, ) -> Option<&mut UiNode>
pub fn copy_node(&mut self, node: Handle<UiNode>) -> Handle<UiNode>
pub fn copy_node_to<Post>( &self, node: Handle<UiNode>, dest: &mut UserInterface, post_process_callback: &mut Post, ) -> (Handle<UiNode>, NodeHandleMap<UiNode>)
pub fn copy_node_with_limit( &mut self, node: Handle<UiNode>, limit: Option<usize>, ) -> Handle<UiNode>
pub fn save(&mut self, path: &Path) -> Result<Visitor, VisitError>
pub async fn load_from_file<P: AsRef<Path>>( path: P, resource_manager: ResourceManager, ) -> Result<Self, VisitError>
pub fn resolve(&mut self)
Sourcepub fn collect_used_resources(&self) -> FxHashSet<UntypedResource>
pub fn collect_used_resources(&self) -> FxHashSet<UntypedResource>
Collects all resources used by the user interface. It uses reflection to “scan” the contents
of the user interface, so if some fields marked with #[reflect(hidden)]
attribute, then
such field will be ignored!
pub async fn load_from_file_ex<P: AsRef<Path>>( path: P, constructors: Arc<WidgetConstructorContainer>, resource_manager: ResourceManager, io: &dyn ResourceIo, ) -> Result<Self, VisitError>
Trait Implementations§
Source§impl AbstractSceneGraph for UserInterface
impl AbstractSceneGraph for UserInterface
fn try_get_node_untyped( &self, handle: ErasedHandle, ) -> Option<&dyn AbstractSceneNode>
fn try_get_node_untyped_mut( &mut self, handle: ErasedHandle, ) -> Option<&mut dyn AbstractSceneNode>
Source§impl BaseSceneGraph for UserInterface
impl BaseSceneGraph for UserInterface
type Prefab = UserInterface
type Node = UiNode
Source§fn set_root(&mut self, root: Handle<Self::Node>)
fn set_root(&mut self, root: Handle<Self::Node>)
Source§fn try_get(&self, handle: Handle<Self::Node>) -> Option<&Self::Node>
fn try_get(&self, handle: Handle<Self::Node>) -> Option<&Self::Node>
Source§fn try_get_mut(&mut self, handle: Handle<Self::Node>) -> Option<&mut Self::Node>
fn try_get_mut(&mut self, handle: Handle<Self::Node>) -> Option<&mut Self::Node>
Source§fn is_valid_handle(&self, handle: Handle<Self::Node>) -> bool
fn is_valid_handle(&self, handle: Handle<Self::Node>) -> bool
Source§fn remove_node(&mut self, node: Handle<Self::Node>)
fn remove_node(&mut self, node: Handle<Self::Node>)
Source§fn link_nodes(&mut self, child: Handle<Self::Node>, parent: Handle<Self::Node>)
fn link_nodes(&mut self, child: Handle<Self::Node>, parent: Handle<Self::Node>)
Source§fn unlink_node(&mut self, node_handle: Handle<Self::Node>)
fn unlink_node(&mut self, node_handle: Handle<Self::Node>)
Source§fn isolate_node(&mut self, node_handle: Handle<Self::Node>)
fn isolate_node(&mut self, node_handle: Handle<Self::Node>)
Source§fn node_mut(&mut self, handle: Handle<Self::Node>) -> &mut Self::Node
fn node_mut(&mut self, handle: Handle<Self::Node>) -> &mut Self::Node
Source§fn change_hierarchy_root(
&mut self,
prev_root: Handle<Self::Node>,
new_root: Handle<Self::Node>,
) -> LinkScheme<Self::Node>
fn change_hierarchy_root( &mut self, prev_root: Handle<Self::Node>, new_root: Handle<Self::Node>, ) -> LinkScheme<Self::Node>
new_root
becomes the root node for the entire hierarchy
under the prev_root
node. For example, if we have this hierarchy and want to set C
as
the new root: Read moreSource§fn apply_link_scheme(&mut self, scheme: LinkScheme<Self::Node>)
fn apply_link_scheme(&mut self, scheme: LinkScheme<Self::Node>)
Self::change_hierarchy_root
.Source§fn remove_nodes(&mut self, nodes: &[Handle<Self::Node>])
fn remove_nodes(&mut self, nodes: &[Handle<Self::Node>])
Source§impl Clone for UserInterface
impl Clone for UserInterface
Source§impl ConstructorProvider<UiNode, UserInterface> for AlphaBar
impl ConstructorProvider<UiNode, UserInterface> for AlphaBar
Source§impl<T: BitContainer> ConstructorProvider<UiNode, UserInterface> for BitField<T>
impl<T: BitContainer> ConstructorProvider<UiNode, UserInterface> for BitField<T>
Source§impl ConstructorProvider<UiNode, UserInterface> for Border
impl ConstructorProvider<UiNode, UserInterface> for Border
Source§impl ConstructorProvider<UiNode, UserInterface> for Button
impl ConstructorProvider<UiNode, UserInterface> for Button
Source§impl ConstructorProvider<UiNode, UserInterface> for Canvas
impl ConstructorProvider<UiNode, UserInterface> for Canvas
Source§impl ConstructorProvider<UiNode, UserInterface> for CheckBox
impl ConstructorProvider<UiNode, UserInterface> for CheckBox
Source§impl ConstructorProvider<UiNode, UserInterface> for ColorField
impl ConstructorProvider<UiNode, UserInterface> for ColorField
Source§impl ConstructorProvider<UiNode, UserInterface> for ColorPicker
impl ConstructorProvider<UiNode, UserInterface> for ColorPicker
Source§impl ConstructorProvider<UiNode, UserInterface> for ColorPoint
impl ConstructorProvider<UiNode, UserInterface> for ColorPoint
Source§impl ConstructorProvider<UiNode, UserInterface> for ContextMenu
impl ConstructorProvider<UiNode, UserInterface> for ContextMenu
Source§impl ConstructorProvider<UiNode, UserInterface> for CurveEditor
impl ConstructorProvider<UiNode, UserInterface> for CurveEditor
Source§impl ConstructorProvider<UiNode, UserInterface> for Decorator
impl ConstructorProvider<UiNode, UserInterface> for Decorator
Source§impl ConstructorProvider<UiNode, UserInterface> for Expander
impl ConstructorProvider<UiNode, UserInterface> for Expander
Source§impl ConstructorProvider<UiNode, UserInterface> for FileBrowser
impl ConstructorProvider<UiNode, UserInterface> for FileBrowser
Source§impl ConstructorProvider<UiNode, UserInterface> for Grid
impl ConstructorProvider<UiNode, UserInterface> for Grid
Source§impl ConstructorProvider<UiNode, UserInterface> for HueBar
impl ConstructorProvider<UiNode, UserInterface> for HueBar
Source§impl ConstructorProvider<UiNode, UserInterface> for Image
impl ConstructorProvider<UiNode, UserInterface> for Image
Source§impl ConstructorProvider<UiNode, UserInterface> for Inspector
impl ConstructorProvider<UiNode, UserInterface> for Inspector
Source§impl ConstructorProvider<UiNode, UserInterface> for ListView
impl ConstructorProvider<UiNode, UserInterface> for ListView
Source§impl ConstructorProvider<UiNode, UserInterface> for Menu
impl ConstructorProvider<UiNode, UserInterface> for Menu
Source§impl ConstructorProvider<UiNode, UserInterface> for MenuItem
impl ConstructorProvider<UiNode, UserInterface> for MenuItem
Source§impl ConstructorProvider<UiNode, UserInterface> for MessageBox
impl ConstructorProvider<UiNode, UserInterface> for MessageBox
Source§impl ConstructorProvider<UiNode, UserInterface> for NinePatch
impl ConstructorProvider<UiNode, UserInterface> for NinePatch
Source§impl<T: NumericType> ConstructorProvider<UiNode, UserInterface> for NumericUpDown<T>
impl<T: NumericType> ConstructorProvider<UiNode, UserInterface> for NumericUpDown<T>
Source§impl ConstructorProvider<UiNode, UserInterface> for PathEditor
impl ConstructorProvider<UiNode, UserInterface> for PathEditor
Source§impl ConstructorProvider<UiNode, UserInterface> for Popup
impl ConstructorProvider<UiNode, UserInterface> for Popup
Source§impl ConstructorProvider<UiNode, UserInterface> for ProgressBar
impl ConstructorProvider<UiNode, UserInterface> for ProgressBar
Source§impl<T: NumericType> ConstructorProvider<UiNode, UserInterface> for RangeEditor<T>
impl<T: NumericType> ConstructorProvider<UiNode, UserInterface> for RangeEditor<T>
Source§impl<T: NumericType> ConstructorProvider<UiNode, UserInterface> for RectEditor<T>
impl<T: NumericType> ConstructorProvider<UiNode, UserInterface> for RectEditor<T>
Source§impl ConstructorProvider<UiNode, UserInterface> for Screen
impl ConstructorProvider<UiNode, UserInterface> for Screen
Source§impl ConstructorProvider<UiNode, UserInterface> for ScrollBar
impl ConstructorProvider<UiNode, UserInterface> for ScrollBar
Source§impl ConstructorProvider<UiNode, UserInterface> for ScrollPanel
impl ConstructorProvider<UiNode, UserInterface> for ScrollPanel
Source§impl ConstructorProvider<UiNode, UserInterface> for SearchBar
impl ConstructorProvider<UiNode, UserInterface> for SearchBar
Source§impl ConstructorProvider<UiNode, UserInterface> for Selector
impl ConstructorProvider<UiNode, UserInterface> for Selector
Source§impl ConstructorProvider<UiNode, UserInterface> for StackPanel
impl ConstructorProvider<UiNode, UserInterface> for StackPanel
Source§impl ConstructorProvider<UiNode, UserInterface> for TabControl
impl ConstructorProvider<UiNode, UserInterface> for TabControl
Source§impl ConstructorProvider<UiNode, UserInterface> for Text
impl ConstructorProvider<UiNode, UserInterface> for Text
Source§impl ConstructorProvider<UiNode, UserInterface> for TextBox
impl ConstructorProvider<UiNode, UserInterface> for TextBox
Source§impl ConstructorProvider<UiNode, UserInterface> for Thumb
impl ConstructorProvider<UiNode, UserInterface> for Thumb
Source§impl ConstructorProvider<UiNode, UserInterface> for Tile
impl ConstructorProvider<UiNode, UserInterface> for Tile
Source§impl ConstructorProvider<UiNode, UserInterface> for Tree
impl ConstructorProvider<UiNode, UserInterface> for Tree
Source§impl ConstructorProvider<UiNode, UserInterface> for TreeRoot
impl ConstructorProvider<UiNode, UserInterface> for TreeRoot
Source§impl ConstructorProvider<UiNode, UserInterface> for UuidEditor
impl ConstructorProvider<UiNode, UserInterface> for UuidEditor
Source§impl<T: NumericType, const D: usize> ConstructorProvider<UiNode, UserInterface> for VecEditor<T, D>
impl<T: NumericType, const D: usize> ConstructorProvider<UiNode, UserInterface> for VecEditor<T, D>
Source§impl ConstructorProvider<UiNode, UserInterface> for VectorImage
impl ConstructorProvider<UiNode, UserInterface> for VectorImage
Source§impl ConstructorProvider<UiNode, UserInterface> for Window
impl ConstructorProvider<UiNode, UserInterface> for Window
Source§impl ConstructorProvider<UiNode, UserInterface> for WrapPanel
impl ConstructorProvider<UiNode, UserInterface> for WrapPanel
Source§impl Debug for UserInterface
impl Debug for UserInterface
Source§impl Default for UserInterface
impl Default for UserInterface
Source§impl<'a> From<&'a mut UserInterface> for BuildContext<'a>
impl<'a> From<&'a mut UserInterface> for BuildContext<'a>
Source§fn from(ui: &'a mut UserInterface) -> Self
fn from(ui: &'a mut UserInterface) -> Self
Source§impl PrefabData for UserInterface
impl PrefabData for UserInterface
Source§impl Reflect for UserInterfacewhere
Self: 'static,
Vector2<f32>: Reflect,
Pool<UiNode, WidgetContainer>: Reflect,
bool: Reflect,
Handle<UiNode>: Reflect,
StyleResource: Reflect,
Vec<Handle<UiNode>>: Reflect,
Vec<RestrictionEntry>: Reflect,
DragContext: Reflect,
MouseState: Reflect,
KeyboardModifiers: Reflect,
CursorIcon: Reflect,
f32: Reflect,
impl Reflect for UserInterfacewhere
Self: 'static,
Vector2<f32>: Reflect,
Pool<UiNode, WidgetContainer>: Reflect,
bool: Reflect,
Handle<UiNode>: Reflect,
StyleResource: Reflect,
Vec<Handle<UiNode>>: Reflect,
Vec<RestrictionEntry>: Reflect,
DragContext: Reflect,
MouseState: Reflect,
KeyboardModifiers: Reflect,
CursorIcon: Reflect,
f32: Reflect,
fn source_path() -> &'static str
fn type_name(&self) -> &'static str
fn doc(&self) -> &'static str
Source§fn assembly_name(&self) -> &'static str
fn assembly_name(&self) -> &'static str
#[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
fn type_assembly_name() -> &'static str
#[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.fn fields_info(&self, func: &mut dyn FnMut(&[FieldInfo<'_, '_>]))
fn into_any(self: Box<Self>) -> 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))
fn as_any_mut(&mut self, func: &mut dyn FnMut(&mut dyn Any))
fn as_reflect(&self, func: &mut dyn FnMut(&dyn Reflect))
fn as_reflect_mut(&mut self, func: &mut dyn FnMut(&mut dyn Reflect))
fn fields(&self, func: &mut dyn FnMut(&[&dyn Reflect]))
fn fields_mut(&mut self, func: &mut dyn FnMut(&mut [&mut dyn Reflect]))
fn field(&self, name: &str, func: &mut dyn FnMut(Option<&dyn Reflect>))
fn field_mut( &mut self, name: &str, func: &mut dyn FnMut(Option<&mut dyn Reflect>), )
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_mut
fn 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)>), )
Source§impl ResourceData for UserInterface
impl ResourceData for UserInterface
Source§fn save(&mut self, path: &Path) -> Result<(), Box<dyn Error>>
fn save(&mut self, path: &Path) -> Result<(), Box<dyn Error>>
Source§fn can_be_saved(&self) -> bool
fn can_be_saved(&self) -> bool
true
if the resource data can be saved to a file, false
- otherwise. Not every
resource type supports saving, for example there might be temporary resource type that is
used only at runtime which does not need saving at all.Source§impl SceneGraph for UserInterface
impl SceneGraph for UserInterface
Source§fn pair_iter(&self) -> impl Iterator<Item = (Handle<Self::Node>, &Self::Node)>
fn pair_iter(&self) -> impl Iterator<Item = (Handle<Self::Node>, &Self::Node)>
Source§fn linear_iter(&self) -> impl Iterator<Item = &Self::Node>
fn linear_iter(&self) -> impl Iterator<Item = &Self::Node>
Source§fn linear_iter_mut(&mut self) -> impl Iterator<Item = &mut Self::Node>
fn linear_iter_mut(&mut self) -> impl Iterator<Item = &mut Self::Node>
Source§fn try_get_of_type<T>(&self, handle: Handle<Self::Node>) -> Option<&T>where
T: 'static,
fn try_get_of_type<T>(&self, handle: Handle<Self::Node>) -> Option<&T>where
T: 'static,
Source§fn try_get_mut_of_type<T>(
&mut self,
handle: Handle<Self::Node>,
) -> Option<&mut T>where
T: 'static,
fn try_get_mut_of_type<T>(
&mut self,
handle: Handle<Self::Node>,
) -> Option<&mut T>where
T: 'static,
Source§fn has_component<T>(&self, handle: Handle<Self::Node>) -> boolwhere
T: 'static,
fn has_component<T>(&self, handle: Handle<Self::Node>) -> boolwhere
T: 'static,
Source§fn find_map<C, T>(
&self,
root_node: Handle<Self::Node>,
cmp: &mut C,
) -> Option<(Handle<Self::Node>, &T)>
fn find_map<C, T>( &self, root_node: Handle<Self::Node>, cmp: &mut C, ) -> Option<(Handle<Self::Node>, &T)>
None
.Source§fn find_up<C>(
&self,
root_node: Handle<Self::Node>,
cmp: &mut C,
) -> Option<(Handle<Self::Node>, &Self::Node)>
fn find_up<C>( &self, root_node: Handle<Self::Node>, cmp: &mut C, ) -> Option<(Handle<Self::Node>, &Self::Node)>
None
.Source§fn find_handle_up<C>(
&self,
root_node: Handle<Self::Node>,
cmp: &mut C,
) -> Handle<Self::Node>
fn find_handle_up<C>( &self, root_node: Handle<Self::Node>, cmp: &mut C, ) -> Handle<Self::Node>
Self::find_up
, but only returns node handle which will be Handle::NONE
if nothing is found.fn find_component_up<T>(
&self,
node_handle: Handle<Self::Node>,
) -> Option<(Handle<Self::Node>, &T)>where
T: 'static,
fn find_component<T>(
&self,
node_handle: Handle<Self::Node>,
) -> Option<(Handle<Self::Node>, &T)>where
T: 'static,
Source§fn find_up_map<C, T>(
&self,
root_node: Handle<Self::Node>,
cmp: &mut C,
) -> Option<(Handle<Self::Node>, &T)>
fn find_up_map<C, T>( &self, root_node: Handle<Self::Node>, cmp: &mut C, ) -> Option<(Handle<Self::Node>, &T)>
None
.Source§fn find_by_name(
&self,
root_node: Handle<Self::Node>,
name: &str,
) -> Option<(Handle<Self::Node>, &Self::Node)>
fn find_by_name( &self, root_node: Handle<Self::Node>, name: &str, ) -> Option<(Handle<Self::Node>, &Self::Node)>
None
.Source§fn find_up_by_name(
&self,
root_node: Handle<Self::Node>,
name: &str,
) -> Option<(Handle<Self::Node>, &Self::Node)>
fn find_up_by_name( &self, root_node: Handle<Self::Node>, name: &str, ) -> Option<(Handle<Self::Node>, &Self::Node)>
None
.Source§fn find_by_name_from_root(
&self,
name: &str,
) -> Option<(Handle<Self::Node>, &Self::Node)>
fn find_by_name_from_root( &self, name: &str, ) -> Option<(Handle<Self::Node>, &Self::Node)>
None
.fn find_handle_by_name_from_root(&self, name: &str) -> Handle<Self::Node>
Source§fn find_from_root<C>(
&self,
cmp: &mut C,
) -> Option<(Handle<Self::Node>, &Self::Node)>
fn find_from_root<C>( &self, cmp: &mut C, ) -> Option<(Handle<Self::Node>, &Self::Node)>
None
.Source§fn find<C>(
&self,
root_node: Handle<Self::Node>,
cmp: &mut C,
) -> Option<(Handle<Self::Node>, &Self::Node)>
fn find<C>( &self, root_node: Handle<Self::Node>, cmp: &mut C, ) -> Option<(Handle<Self::Node>, &Self::Node)>
None
.Source§fn find_handle<C>(
&self,
root_node: Handle<Self::Node>,
cmp: &mut C,
) -> Handle<Self::Node>
fn find_handle<C>( &self, root_node: Handle<Self::Node>, cmp: &mut C, ) -> Handle<Self::Node>
Self::find
, but only returns node handle which will be Handle::NONE
if nothing is found.Source§fn relative_position(
&self,
child: Handle<Self::Node>,
offset: isize,
) -> Option<(Handle<Self::Node>, usize)>
fn relative_position( &self, child: Handle<Self::Node>, offset: isize, ) -> Option<(Handle<Self::Node>, usize)>
offset
to the position. For example, if you have the following hierarchy: Read moreSource§fn traverse_iter(
&self,
from: Handle<Self::Node>,
) -> impl Iterator<Item = (Handle<Self::Node>, &Self::Node)>
fn traverse_iter( &self, from: Handle<Self::Node>, ) -> impl Iterator<Item = (Handle<Self::Node>, &Self::Node)>
Source§fn traverse_handle_iter(
&self,
from: Handle<Self::Node>,
) -> impl Iterator<Item = Handle<Self::Node>>
fn traverse_handle_iter( &self, from: Handle<Self::Node>, ) -> impl Iterator<Item = Handle<Self::Node>>
Source§fn restore_integrity<F>(
&mut self,
instantiate: F,
) -> Vec<(Handle<Self::Node>, Resource<Self::Prefab>)>
fn restore_integrity<F>( &mut self, instantiate: F, ) -> Vec<(Handle<Self::Node>, Resource<Self::Prefab>)>
fn restore_original_handles_and_inherit_properties<F>( &mut self, ignored_types: &[TypeId], before_inherit: F, )
Source§fn remap_handles(
&mut self,
instances: &[(Handle<Self::Node>, Resource<Self::Prefab>)],
)
fn remap_handles( &mut self, instances: &[(Handle<Self::Node>, Resource<Self::Prefab>)], )
Source§impl TypeUuidProvider for UserInterface
impl TypeUuidProvider for UserInterface
Source§impl Visit for UserInterface
impl Visit for UserInterface
Source§fn visit(&mut self, name: &str, visitor: &mut Visitor) -> VisitResult
fn visit(&mut self, name: &str, visitor: &mut Visitor) -> VisitResult
Auto Trait Implementations§
impl !Freeze for UserInterface
impl !RefUnwindSafe for UserInterface
impl Send for UserInterface
impl !Sync for UserInterface
impl Unpin for UserInterface
impl !UnwindSafe for UserInterface
Blanket Implementations§
Source§impl<T> AsyncTaskResult for T
impl<T> AsyncTaskResult 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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
.Source§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
.Source§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.Source§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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Any
. Could be used to downcast a trait object
to a particular type.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Any
. Could be used to downcast a trait object
to a particular type.fn into_any(self: Box<T>) -> Box<dyn Any>
Source§impl<T> FieldValue for Twhere
T: 'static,
impl<T> FieldValue for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ReflectBase for Twhere
T: Reflect,
impl<T> ReflectBase for Twhere
T: Reflect,
fn as_any_raw(&self) -> &(dyn Any + 'static)
fn as_any_raw_mut(&mut self) -> &mut (dyn Any + 'static)
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<'p, T>(
&self,
path: &'p str,
func: &mut dyn FnMut(Result<&T, ReflectPathError<'p>>),
)where
T: Reflect,
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§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).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.