Struct UserInterface

Source
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

Source

pub const SCREEN_SIZE: &'static str = "screen_size"

Source

pub const NODES: &'static str = "nodes"

Source

pub const VISUAL_DEBUG: &'static str = "visual_debug"

Source

pub const ROOT_CANVAS: &'static str = "root_canvas"

Source

pub const PICKED_NODE: &'static str = "picked_node"

Source

pub const PREV_PICKED_NODE: &'static str = "prev_picked_node"

Source

pub const CAPTURED_NODE: &'static str = "captured_node"

Source

pub const KEYBOARD_FOCUS_NODE: &'static str = "keyboard_focus_node"

Source

pub const CURSOR_POSITION: &'static str = "cursor_position"

Source

pub const STYLE: &'static str = "style"

Source

pub const STACK: &'static str = "stack"

Source

pub const PICKING_STACK: &'static str = "picking_stack"

Source

pub const DRAG_CONTEXT: &'static str = "drag_context"

Source

pub const MOUSE_STATE: &'static str = "mouse_state"

Source

pub const KEYBOARD_MODIFIERS: &'static str = "keyboard_modifiers"

Source

pub const CURSOR_ICON: &'static str = "cursor_icon"

Source

pub const NEED_UPDATE_GLOBAL_TRANSFORM: &'static str = "need_update_global_transform"

Source

pub const DOUBLE_CLICK_TIME_SLICE: &'static str = "double_click_time_slice"

Source

pub const TOOLTIP_APPEAR_DELAY: &'static str = "tooltip_appear_delay"

Source§

impl UserInterface

Source

pub fn new(screen_size: Vector2<f32>) -> UserInterface

Source

pub fn new_with_channel( sender: Sender<UiMessage>, receiver: Receiver<UiMessage>, screen_size: Vector2<f32>, ) -> UserInterface

Source

pub fn set_tooltip_appear_delay(&mut self, appear_delay: f32)

Source

pub fn tooltip_appear_delay(&self) -> f32

Source

pub fn active_tooltip(&self) -> Option<&TooltipEntry>

Source

pub fn keyboard_modifiers(&self) -> KeyboardModifiers

Source

pub fn build_ctx(&mut self) -> BuildContext<'_>

Source

pub fn capture_mouse(&mut self, node: Handle<UiNode>) -> bool

Source

pub fn release_mouse_capture(&mut self)

Source

pub fn get_drawing_context(&self) -> &DrawingContext

Source

pub fn get_drawing_context_mut(&mut self) -> &mut DrawingContext

Source

pub fn is_node_enabled(&self, handle: Handle<UiNode>) -> bool

Source

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

Source

pub fn set_screen_size(&mut self, screen_size: Vector2<f32>)

Source

pub fn invalidate_layout(&mut self)

Source

pub fn update_layout(&mut self, screen_size: Vector2<f32>)

Source

pub fn update( &mut self, screen_size: Vector2<f32>, dt: f32, switches: &UiUpdateSwitches, )

Source

pub fn style(&self) -> &StyleResource

Source

pub fn set_style(&mut self, style: StyleResource)

Source

pub fn cursor(&self) -> CursorIcon

Source

pub fn set_time(&mut self, elapsed_time: f32)

Source

pub fn draw(&mut self) -> &DrawingContext

Source

pub fn clipboard(&self) -> Option<Ref<'_, ClipboardContext>>

Source

pub fn clipboard_mut(&self) -> Option<RefMut<'_, ClipboardContext>>

Source

pub fn arrange_node( &self, handle: Handle<UiNode>, final_rect: &Rect<f32>, ) -> bool

Source

pub fn measure_node( &self, handle: Handle<UiNode>, available_size: Vector2<f32>, ) -> bool

Source

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

Cursor position in screen space coordinate system.

Source

pub fn hit_test_unrestricted(&self, pt: Vector2<f32>) -> Handle<UiNode>

Source

pub fn hit_test(&self, pt: Vector2<f32>) -> Handle<UiNode>

Source

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.

Source

pub fn sender(&self) -> Sender<UiMessage>

Returns instance of message sender which can be used to push messages into queue from other threads.

Source

pub fn send_message(&self, message: UiMessage)

Source

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.

Source

pub fn screen_to_root_canvas_space( &self, position: Vector2<f32>, ) -> Vector2<f32>

Source

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

Source

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.

Source

pub fn nodes(&self) -> &Pool<UiNode, WidgetContainer>

Source

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

Source

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!

Source

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.

Source

pub fn forget_ticket(&mut self, ticket: Ticket<UiNode>, node: UiNode) -> UiNode

Makes a widget handle vacant again.

Source

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!

Source

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.

Source

pub fn forget_sub_graph(&mut self, sub_graph: SubGraph)

Forgets the entire sub-graph making handles to widgets invalid.

Source

pub fn push_picking_restriction(&mut self, restriction: RestrictionEntry)

Source

pub fn remove_picking_restriction(&mut self, node: Handle<UiNode>)

Source

pub fn picking_restriction_stack(&self) -> &[RestrictionEntry]

Source

pub fn drop_picking_restrictions(&mut self)

Removes all picking restrictions.

Source

pub fn top_picking_restriction(&self) -> Option<RestrictionEntry>

Source

pub fn drag_context(&self) -> &DragContext

Links the specified child widget with the specified parent widget.

Source

pub fn node_mut(&mut self, node_handle: Handle<UiNode>) -> &mut UiNode

Source

pub fn try_get_node_mut( &mut self, node_handle: Handle<UiNode>, ) -> Option<&mut UiNode>

Source

pub fn copy_node(&mut self, node: Handle<UiNode>) -> Handle<UiNode>

Source

pub fn copy_node_to<Post>( &self, node: Handle<UiNode>, dest: &mut UserInterface, post_process_callback: &mut Post, ) -> (Handle<UiNode>, NodeHandleMap<UiNode>)
where Post: FnMut(Handle<UiNode>, Handle<UiNode>, &mut UiNode),

Source

pub fn copy_node_with_limit( &mut self, node: Handle<UiNode>, limit: Option<usize>, ) -> Handle<UiNode>

Source

pub fn save(&mut self, path: &Path) -> Result<Visitor, VisitError>

Source

pub async fn load_from_file<P: AsRef<Path>>( path: P, resource_manager: ResourceManager, ) -> Result<Self, VisitError>

Source

pub fn resolve(&mut self)

Source

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!

Source

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

Source§

impl BaseSceneGraph for UserInterface

Source§

type Prefab = UserInterface

Source§

type Node = UiNode

Source§

fn root(&self) -> Handle<Self::Node>

Returns a handle of the root node of the graph.
Source§

fn set_root(&mut self, root: Handle<Self::Node>)

Sets the new root of the graph. If used incorrectly, it may create isolated sub-graphs.
Source§

fn try_get(&self, handle: Handle<Self::Node>) -> Option<&Self::Node>

Tries to borrow a node, returns Some(node) if the handle is valid, None - otherwise.
Source§

fn try_get_mut(&mut self, handle: Handle<Self::Node>) -> Option<&mut Self::Node>

Tries to borrow a node, returns Some(node) if the handle is valid, None - otherwise.
Source§

fn is_valid_handle(&self, handle: Handle<Self::Node>) -> bool

Checks whether the given node handle is valid or not.
Source§

fn add_node(&mut self, node: Self::Node) -> Handle<Self::Node>

Adds a new node to the graph.
Source§

fn remove_node(&mut self, node: Handle<Self::Node>)

Destroys the node and its children recursively.
Links specified child with specified parent.
Unlinks specified node from its parent and attaches it to root graph node.
Source§

fn isolate_node(&mut self, node_handle: Handle<Self::Node>)

Detaches the node from its parent, making the node unreachable from any other node in the graph.
Source§

fn node(&self, handle: Handle<Self::Node>) -> &Self::Node

Borrows a node by its handle.
Source§

fn node_mut(&mut self, handle: Handle<Self::Node>) -> &mut Self::Node

Borrows a node by its handle.
Source§

fn change_hierarchy_root( &mut self, prev_root: Handle<Self::Node>, new_root: Handle<Self::Node>, ) -> LinkScheme<Self::Node>

Reorders the node hierarchy so the 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 more
Applies the given link scheme to the graph, basically reverting graph structure to the one that was before the call of Self::change_hierarchy_root.
Source§

fn remove_nodes(&mut self, nodes: &[Handle<Self::Node>])

Removes all the nodes from the given slice.
Source§

impl Clone for UserInterface

Source§

fn clone(&self) -> Self

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 ConstructorProvider<UiNode, UserInterface> for AbsmEventProvider

Source§

impl ConstructorProvider<UiNode, UserInterface> for AlphaBar

Source§

impl ConstructorProvider<UiNode, UserInterface> for AnimationBlendingStateMachine

Source§

impl ConstructorProvider<UiNode, UserInterface> for AnimationPlayer

Source§

impl<T: BitContainer> ConstructorProvider<UiNode, UserInterface> for BitField<T>

Source§

impl ConstructorProvider<UiNode, UserInterface> for Border

Source§

impl ConstructorProvider<UiNode, UserInterface> for Button

Source§

impl ConstructorProvider<UiNode, UserInterface> for Canvas

Source§

impl ConstructorProvider<UiNode, UserInterface> for CheckBox

Source§

impl ConstructorProvider<UiNode, UserInterface> for ColorField

Source§

impl ConstructorProvider<UiNode, UserInterface> for ColorGradientEditor

Source§

impl ConstructorProvider<UiNode, UserInterface> for ColorGradientField

Source§

impl ConstructorProvider<UiNode, UserInterface> for ColorPicker

Source§

impl ConstructorProvider<UiNode, UserInterface> for ColorPoint

Source§

impl ConstructorProvider<UiNode, UserInterface> for ContextMenu

Source§

impl ConstructorProvider<UiNode, UserInterface> for CurveEditor

Source§

impl ConstructorProvider<UiNode, UserInterface> for Decorator

Source§

impl ConstructorProvider<UiNode, UserInterface> for DockingManager

Source§

impl ConstructorProvider<UiNode, UserInterface> for DropdownList

Source§

impl ConstructorProvider<UiNode, UserInterface> for Expander

Source§

impl ConstructorProvider<UiNode, UserInterface> for FileBrowser

Source§

impl ConstructorProvider<UiNode, UserInterface> for FileSelector

Source§

impl ConstructorProvider<UiNode, UserInterface> for FileSelectorField

Source§

impl ConstructorProvider<UiNode, UserInterface> for Grid

Source§

impl ConstructorProvider<UiNode, UserInterface> for HotKeyEditor

Source§

impl ConstructorProvider<UiNode, UserInterface> for HueBar

Source§

impl ConstructorProvider<UiNode, UserInterface> for Image

Source§

impl ConstructorProvider<UiNode, UserInterface> for Inspector

Source§

impl ConstructorProvider<UiNode, UserInterface> for KeyBindingEditor

Source§

impl ConstructorProvider<UiNode, UserInterface> for ListView

Source§

impl ConstructorProvider<UiNode, UserInterface> for ListViewItem

Source§

impl ConstructorProvider<UiNode, UserInterface> for Menu

Source§

impl ConstructorProvider<UiNode, UserInterface> for MenuItem

Source§

impl ConstructorProvider<UiNode, UserInterface> for MessageBox

Source§

impl ConstructorProvider<UiNode, UserInterface> for NinePatch

Source§

impl<T: NumericType> ConstructorProvider<UiNode, UserInterface> for NumericUpDown<T>

Source§

impl ConstructorProvider<UiNode, UserInterface> for PathEditor

Source§

impl ConstructorProvider<UiNode, UserInterface> for Popup

Source§

impl ConstructorProvider<UiNode, UserInterface> for ProgressBar

Source§

impl<T: NumericType> ConstructorProvider<UiNode, UserInterface> for RangeEditor<T>

Source§

impl<T: NumericType> ConstructorProvider<UiNode, UserInterface> for RectEditor<T>

Source§

impl ConstructorProvider<UiNode, UserInterface> for SaturationBrightnessField

Source§

impl ConstructorProvider<UiNode, UserInterface> for Screen

Source§

impl ConstructorProvider<UiNode, UserInterface> for ScrollBar

Source§

impl ConstructorProvider<UiNode, UserInterface> for ScrollPanel

Source§

impl ConstructorProvider<UiNode, UserInterface> for ScrollViewer

Source§

impl ConstructorProvider<UiNode, UserInterface> for Selector

Source§

impl ConstructorProvider<UiNode, UserInterface> for StackPanel

Source§

impl ConstructorProvider<UiNode, UserInterface> for TabControl

Source§

impl ConstructorProvider<UiNode, UserInterface> for Text

Source§

impl ConstructorProvider<UiNode, UserInterface> for TextBox

Source§

impl ConstructorProvider<UiNode, UserInterface> for Thumb

Source§

impl ConstructorProvider<UiNode, UserInterface> for Tile

Source§

impl ConstructorProvider<UiNode, UserInterface> for ToggleButton

Source§

impl ConstructorProvider<UiNode, UserInterface> for Tree

Source§

impl ConstructorProvider<UiNode, UserInterface> for TreeRoot

Source§

impl ConstructorProvider<UiNode, UserInterface> for UuidEditor

Source§

impl<T: NumericType, const D: usize> ConstructorProvider<UiNode, UserInterface> for VecEditor<T, D>

Source§

impl ConstructorProvider<UiNode, UserInterface> for VectorImage

Source§

impl ConstructorProvider<UiNode, UserInterface> for Window

Source§

impl ConstructorProvider<UiNode, UserInterface> for WrapPanel

Source§

impl Debug for UserInterface

Source§

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

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

impl Default for UserInterface

Source§

fn default() -> Self

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

impl<'a> From<&'a mut UserInterface> for BuildContext<'a>

Source§

fn from(ui: &'a mut UserInterface) -> Self

Converts to this type from the input type.
Source§

impl PrefabData for UserInterface

Source§

impl Reflect for UserInterface

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 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 set_field( &mut self, field: &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_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 ResourceData for UserInterface

Source§

fn type_uuid(&self) -> Uuid

Returns unique data type id.
Source§

fn save(&mut self, path: &Path) -> Result<(), Box<dyn Error>>

Saves the resource data a file at the specified path. This method is free to decide how the resource data is saved. This is needed, because there are multiple formats that defines various kinds of resources. For example, a rectangular texture could be saved into a bunch of formats, such as png, bmp, tga, jpg etc., but in the engine it is single Texture resource. In any case, produced file should be compatible with a respective resource loader.
Source§

fn can_be_saved(&self) -> bool

Returns 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

Source§

fn pair_iter(&self) -> impl Iterator<Item = (Handle<Self::Node>, &Self::Node)>

Creates new iterator that iterates over internal collection giving (handle; node) pairs.
Source§

fn linear_iter(&self) -> impl Iterator<Item = &Self::Node>

Creates an iterator that has linear iteration order over internal collection of nodes. It does not perform any tree traversal!
Source§

fn linear_iter_mut(&mut self) -> impl Iterator<Item = &mut Self::Node>

Creates an iterator that has linear iteration order over internal collection of nodes. It does not perform any tree traversal!
Source§

fn try_get_of_type<T>(&self, handle: Handle<Self::Node>) -> Option<&T>
where T: 'static,

Tries to borrow a node and fetch its component of specified type.
Source§

fn try_get_mut_of_type<T>( &mut self, handle: Handle<Self::Node>, ) -> Option<&mut T>
where T: 'static,

Tries to mutably borrow a node and fetch its component of specified type.
Source§

fn has_component<T>(&self, handle: Handle<Self::Node>) -> bool
where T: 'static,

Tries to borrow a node by the given handle and checks if it has a component of the specified type.
Source§

fn find_map<C, T>( &self, root_node: Handle<Self::Node>, cmp: &mut C, ) -> Option<(Handle<Self::Node>, &T)>
where C: FnMut(&Self::Node) -> Option<&T>, T: ?Sized,

Searches for a node down the tree starting from the specified node using the specified closure. Returns a tuple with a handle and a reference to the mapped value. If nothing is found, it returns None.
Source§

fn find_up<C>( &self, root_node: Handle<Self::Node>, cmp: &mut C, ) -> Option<(Handle<Self::Node>, &Self::Node)>
where C: FnMut(&Self::Node) -> bool,

Searches for a node up the tree starting from the specified node using the specified closure. Returns a tuple with a handle and a reference to the found node. If nothing is found, it returns None.
Source§

fn find_handle_up<C>( &self, root_node: Handle<Self::Node>, cmp: &mut C, ) -> Handle<Self::Node>
where C: FnMut(&Self::Node) -> bool,

The same as Self::find_up, but only returns node handle which will be Handle::NONE if nothing is found.
Source§

fn find_component_up<T>( &self, node_handle: Handle<Self::Node>, ) -> Option<(Handle<Self::Node>, &T)>
where T: 'static,

Source§

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)>
where C: FnMut(&Self::Node) -> Option<&T>, T: ?Sized,

Searches for a node up the tree starting from the specified node using the specified closure. Returns a tuple with a handle and a reference to the mapped value. If nothing is found, it returns None.
Source§

fn find_by_name( &self, root_node: Handle<Self::Node>, name: &str, ) -> Option<(Handle<Self::Node>, &Self::Node)>

Searches for a node with the specified name down the tree starting from the specified node. Returns a tuple with a handle and a reference to the found node. If nothing is found, it returns None.
Source§

fn find_up_by_name( &self, root_node: Handle<Self::Node>, name: &str, ) -> Option<(Handle<Self::Node>, &Self::Node)>

Searches for a node with the specified name up the tree starting from the specified node. Returns a tuple with a handle and a reference to the found node. If nothing is found, it returns None.
Source§

fn find_by_name_from_root( &self, name: &str, ) -> Option<(Handle<Self::Node>, &Self::Node)>

Searches for a node with the specified name down the tree starting from the graph root. Returns a tuple with a handle and a reference to the found node. If nothing is found, it returns None.
Source§

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)>
where C: FnMut(&Self::Node) -> bool,

Searches node using specified compare closure starting from root. Returns a tuple with a handle and a reference to the found node. If nothing is found, it returns None.
Source§

fn find<C>( &self, root_node: Handle<Self::Node>, cmp: &mut C, ) -> Option<(Handle<Self::Node>, &Self::Node)>
where C: FnMut(&Self::Node) -> bool,

Searches for a node down the tree starting from the specified node using the specified closure. Returns a tuple with a handle and a reference to the found node. If nothing is found, it returns None.
Source§

fn find_handle<C>( &self, root_node: Handle<Self::Node>, cmp: &mut C, ) -> Handle<Self::Node>
where C: FnMut(&Self::Node) -> bool,

The same as 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)>

Returns position of the node in its parent children list and the handle to the parent. Adds given offset to the position. For example, if you have the following hierarchy: Read more
Source§

fn traverse_iter( &self, from: Handle<Self::Node>, ) -> impl Iterator<Item = (Handle<Self::Node>, &Self::Node)>

Create a graph depth traversal iterator.
Source§

fn traverse_handle_iter( &self, from: Handle<Self::Node>, ) -> impl Iterator<Item = Handle<Self::Node>>

Create a graph depth traversal iterator.
Source§

fn restore_integrity<F>( &mut self, instantiate: F, ) -> Vec<(Handle<Self::Node>, Resource<Self::Prefab>)>
where F: FnMut(Resource<Self::Prefab>, &Self::Prefab, Handle<Self::Node>, &mut Self) -> (Handle<Self::Node>, NodeHandleMap<Self::Node>),

This method checks integrity of the graph and restores it if needed. For example, if a node was added in a parent asset, then it must be added in the graph. Alternatively, if a node was deleted in a parent asset, then its instance must be deleted in the graph.
Source§

fn restore_original_handles_and_inherit_properties<F>( &mut self, ignored_types: &[TypeId], before_inherit: F, )
where F: FnMut(&Self::Node, &mut Self::Node),

Source§

fn remap_handles( &mut self, instances: &[(Handle<Self::Node>, Resource<Self::Prefab>)], )

Maps handles in properties of instances after property inheritance. It is needed, because when a property contains node handle, the handle cannot be used directly after inheritance. Instead, it must be mapped to respective instance first. Read more
Source§

impl TypeUuidProvider for UserInterface

Source§

fn type_uuid() -> Uuid

Return type UUID.
Source§

impl Visit for UserInterface

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§

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

impl<T> CollectionItem for T
where T: Clone + Reflect + Debug + Default + TypeUuidProvider + Send + 'static,

Source§

impl<T> InspectableEnum for T
where T: Debug + Reflect + Clone + TypeUuidProvider + Send + 'static,

Source§

impl<T> TypedResourceData for T