Skip to main content

UserInterface

Struct UserInterface 

Source
pub struct UserInterface {
    pub drawing_context: DrawingContext,
    pub style: Resource<Style>,
    pub default_font: Resource<Font>,
    pub double_click_time_slice: f32,
    pub tooltip_appear_delay: f32,
    pub standard_material: WidgetMaterial,
    pub render_target: Option<Resource<Texture>>,
    pub render_mode: RenderMode,
    pub need_render: bool,
    pub user_data: DynTypeContainer,
    /* private fields */
}

Fields§

§drawing_context: DrawingContext§style: Resource<Style>§default_font: Resource<Font>§double_click_time_slice: f32§tooltip_appear_delay: f32§standard_material: WidgetMaterial§render_target: Option<Resource<Texture>>

Optional render target of the user interface. The UI will be rendered in such target with and the target size will be set to the screen size of the user interface.

§render_mode: RenderMode

Render mode of the user interface. See RenderMode docs for more info.

§need_render: bool

A flag that indicates that the UI should be rendered. It is only taken into account if the render mode is set to RenderMode::OnChanges.

§user_data: DynTypeContainer

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 DOUBLE_CLICK_TIME_SLICE: &'static str = "double_click_time_slice"

Source

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

Source

pub const STANDARD_MATERIAL: &'static str = "standard_material"

Source

pub const RENDER_TARGET: &'static str = "render_target"

Source

pub const RENDER_MODE: &'static str = "render_mode"

Source

pub const NEED_RENDER: &'static str = "need_render"

Source

pub const USER_DATA: &'static str = "user_data"

Source§

impl UserInterface

Source

pub fn new( screen_size: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>, ) -> UserInterface

Source

pub fn new_with_channel( sender: Sender<UiMessage>, receiver: Receiver<UiMessage>, screen_size: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>, ) -> 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<impl ObjectOrVariant<UiNode>>, ) -> bool

Source

pub fn release_mouse_capture(&mut self)

Source

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

Source

pub fn screen_size( &self, ) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>

Source

pub fn set_screen_size( &mut self, screen_size: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>, )

Source

pub fn invalidate_layout(&mut self)

Source

pub fn update_layout( &mut self, screen_size: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>, )

Source

pub fn update( &mut self, screen_size: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>, dt: f32, switches: &UiUpdateSwitches, )

Source

pub fn style(&self) -> &Resource<Style>

Source

pub fn set_style(&mut self, style: Resource<Style>)

Source

pub fn cursor(&self) -> CursorIcon

Source

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

Source

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

Source

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

Source

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

Source

pub fn measure_node( &self, handle: Handle<impl ObjectOrVariant<UiNode>>, available_size: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>, ) -> bool

Source

pub fn cursor_position( &self, ) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>

Cursor position in screen space coordinate system.

Source

pub fn hit_test_unrestricted( &self, pt: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>, ) -> Handle<UiNode>

Source

pub fn hit_test( &self, pt: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>, ) -> Handle<UiNode>

Source

pub fn is_node_child_of( &self, node_handle: Handle<impl ObjectOrVariant<UiNode>>, root_handle: Handle<impl ObjectOrVariant<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 has_descendant_or_equal( &self, node_handle: Handle<impl ObjectOrVariant<UiNode>>, root_handle: Handle<impl ObjectOrVariant<UiNode>>, ) -> bool

Checks if the specified node is a descendant of the hierarchy defined by a root_handle or the given handles are equal.

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 send_messages<const N: usize>(&self, messages: [UiMessage; N])

Source

pub fn send( &self, handle: Handle<impl ObjectOrVariant<UiNode>>, data: impl MessageData, )

Source

pub fn send_handled( &self, handle: Handle<impl ObjectOrVariant<UiNode>>, data: impl MessageData, )

Source

pub fn send_sync( &self, handle: Handle<impl ObjectOrVariant<UiNode>>, data: impl MessageData, )

Source

pub fn send_with_flags<T>( &self, handle: Handle<impl ObjectOrVariant<UiNode>>, flags: u64, data: T, )
where T: MessageData,

Source

pub fn send_many<const N: usize, T>( &self, handle: Handle<impl ObjectOrVariant<UiNode>>, payload: [T; N], )
where T: MessageData,

Source

pub fn send_sync_many<const N: usize, T>( &self, handle: Handle<impl ObjectOrVariant<UiNode>>, payload: [T; N], )
where T: MessageData,

Source

pub fn post<T>(&self, handle: Handle<impl ObjectOrVariant<UiNode>>, data: T)
where T: MessageData,

Source

pub fn post_many<const N: usize, T>( &self, handle: Handle<impl ObjectOrVariant<UiNode>>, payload: [T; N], )
where T: MessageData,

Source

pub fn poll_message_queue(&mut self) -> PollResult

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 the most important methods which must be called each frame of your game loop, otherwise the UI will not respond to any kind of events and simply speaking will just not work.

§Routing Scheme

The following scheme shows the full routing procedure for a single method call.


    poll_message                                                          return message;
          │                   Discard Message                                    ▲
          ├─────────────────────────────◄───────────────────────────┐            │
          │                                                         │   Delivery │
          │                                                         │   Mode     │
┌─────────▼─────────┐  ┌─────────────────────────────────────┐      │    ┌───────┼──────┐
│Message            │  │ Destination                         │      │    │ Full Cycle?  │
│Queue              │  │ Widget Sub-Tree                     │      │    ├──────────────┤
│   ┌───────────┐   │  │                                     │      └────┼ Sync Only?   │
│   │  Message  │   │  │ Bubble Routing                      │           └───────▲──────┘
│   └───────────┘   │  │ ┌─────────────────────────────────┐ │                   │
│   ┌───────────┐   │  │ │   Root::handle_routed_message   ├─┼─────────►─────────┤
│   │  Message  │   │  │ └────────────────▲────────────────┘ │                   │
│   └───────────┘   │  │                 ...                 │                   │
│        ...        │  │ ┌────────────────┼────────────────┐ │                   │
│   ┌───────────┐   │  │ │  Parent::handle_routed_message  │ │                   │
│   │  Message  │   │  │ └────────────────▲────────────────┘ │                   │
│   └───────────┘   │  │                  │                  │                   │
│   ┌───────────┐   │  │ ┌────────────────┼────────────────┐ │  Direct Routing   │
│   │  Message  │   │  │ │  Widget::handle_routed_message  │ │  ┌────────────────┼────────────────┐
│   └─────────┬─┘   │  │ └────────────────▲────────────────┘ │  │  Widget::handle_routed_message  │
└─────────────┼─────┘  └──────────────────┼──────────────────┘  └────────────────▲────────────────┘
              │                           │                                      │
    pop_front │                  Routing  │                                      │
              │                  Strategy │                                      │
┌─────────────┼───────────────┐   ┌──────────────────┐                           │
│Preview Set  │               │   │ Bubble Routing?  │                           │
│ ┌───────────▼─────────────┐ │   ├──────────────────┤                           │
│ │ Widget::preview_message │ │   │ Direct Routing?  ├───────────────────────────┘
│ └───────────┬─────────────┘ │   └──────────────────┘
│             │               │           │
│ ┌───────────▼─────────────┐ │           │
│ │ Widget::preview_message │ │           │
│ └───────────┬─────────────┘ │           │
│             │               │           │
│ ┌───────────▼─────────────┐ │           │
│ │ Widget::preview_message─┼─┼───────────┘
│ └─────────────────────────┘ │ To destination
└─────────────────────────────┘ widget

Keep in mind, that any number of widget may produce some other messages during this method call. These messages will be put at the end of the queue.

§Returns

This method returns a PollResult with processed message number and the last processed message that has DeliveryMode::FullCycle. See the diagram above for the explanation.

Source

pub fn poll_message(&mut self) -> Option<UiMessage>

Same as Self::poll_message_queue, but discards the number of processed message the last processed message that has DeliveryMode::FullCycle.

Source

pub fn screen_to_root_canvas_space( &self, position: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>, ) -> Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>

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 receive 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 become 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 the 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 restricts_picking(&self, node: Handle<UiNode>) -> bool

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>, ) -> Result<&mut UiNode, PoolError>

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>( path: P, constructors: Arc<GraphNodeConstructorContainer<UiNode, UserInterface>>, dyn_type_constructors: Arc<DynTypeConstructorContainer>, resource_manager: ResourceManager, ) -> Result<UserInterface, VisitError>
where P: AsRef<Path>,

Source

pub fn resolve(&mut self)

Source

pub fn collect_used_resources( &self, ) -> HashSet<UntypedResource, BuildHasherDefault<FxHasher>>

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>( path: P, constructors: Arc<GraphNodeConstructorContainer<UiNode, UserInterface>>, dyn_type_constructors: Arc<DynTypeConstructorContainer>, resource_manager: ResourceManager, io: &(dyn ResourceIo + 'static), ) -> Result<UserInterface, VisitError>
where P: AsRef<Path>,

Trait Implementations§

Source§

impl AnimationSource for UserInterface

Source§

type Prefab = UserInterface

Prefab type.
Source§

type SceneGraph = UserInterface

Scene graph type.
Source§

type Node = UiNode

Scene node type.
Source§

fn inner_graph(&self) -> &Self::SceneGraph

Returns a reference to an inner graph.
Source§

fn retarget_animations_directly( &self, root: Handle<Self::Node>, graph: &Self::SceneGraph, self_kind: ResourceKind, ) -> Vec<Animation<Handle<Self::Node>>>

Tries to retarget animations from given model resource to a node hierarchy starting from root on a given scene. Read more
Source§

fn retarget_animations_to_player( &self, root: Handle<Self::Node>, dest_animation_player: Handle<Self::Node>, graph: &mut Self::SceneGraph, self_kind: ResourceKind, ) -> Vec<Handle<Animation<Handle<Self::Node>>>>

Tries to retarget animations from given model resource to a node hierarchy starting from root on a given scene. Unlike Self::retarget_animations_directly, it automatically adds retargetted animations to the specified animation player in the hierarchy of given root. Read more
Source§

fn retarget_animations( &self, root: Handle<Self::Node>, graph: &mut Self::SceneGraph, self_kind: ResourceKind, ) -> Vec<Handle<Animation<Handle<Self::Node>>>>

Tries to retarget animations from given model resource to a node hierarchy starting from root on a given scene. Unlike Self::retarget_animations_directly, it automatically adds retargetted animations to a first animation player in the hierarchy of given root. Read more
Source§

impl Clone for UserInterface

Source§

fn clone(&self) -> UserInterface

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> ConstructorProvider<UiNode, UserInterface> for BitField<T>
where T: BitContainer,

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> ConstructorProvider<UiNode, UserInterface> for NumericUpDown<T>
where T: NumericType,

Source§

impl ConstructorProvider<UiNode, UserInterface> for PathEditor

Source§

impl ConstructorProvider<UiNode, UserInterface> for Popup

Source§

impl ConstructorProvider<UiNode, UserInterface> for ProgressBar

Source§

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

Source§

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

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, const D: usize> ConstructorProvider<UiNode, UserInterface> for VecEditor<T, D>
where T: NumericType,

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<(), Error>

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

impl Default for UserInterface

Source§

fn default() -> UserInterface

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) -> BuildContext<'a>

Converts to this type from the input type.
Source§

impl<T> Index<Handle<T>> for UserInterface

Source§

type Output = T

The returned type after indexing.
Source§

fn index( &self, index: Handle<T>, ) -> &<UserInterface as Index<Handle<T>>>::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<T> IndexMut<Handle<T>> for UserInterface

Source§

fn index_mut( &mut self, index: Handle<T>, ) -> &mut <UserInterface as Index<Handle<T>>>::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl PrefabData for UserInterface

Source§

impl Reflect for UserInterface
where UserInterface: 'static,

Source§

fn source_path() -> &'static str

Source§

fn try_clone_box(&self) -> Option<Box<dyn Reflect>>

Source§

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

Source§

fn derived_types() -> &'static [TypeId]

Source§

fn query_derived_types(&self) -> &'static [TypeId]

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_ref(&self, func: &mut dyn FnMut(&[FieldRef<'_, '_>]))

Source§

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

Source§

fn into_any(self: Box<UserInterface>) -> 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 + 'static)))

Source§

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

Source§

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

Source§

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

Source§

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

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

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

Source§

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

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§

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

Source§

fn as_handle_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectHandle + '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§

fn try_clone_box(&self) -> Option<Box<dyn ResourceData>>

Tries to clone the resource data. This method can return None if the underlying type is non-cloneable.
Source§

impl SceneGraph for UserInterface

Source§

type Prefab = UserInterface

Source§

type NodeContainer = WidgetContainer

Source§

type Node = UiNode

Source§

fn summary(&self) -> String

Generate a string that briefly summarizes the content of the graph for debugging.
Source§

fn actual_type_id( &self, handle: Handle<<UserInterface as SceneGraph>::Node>, ) -> Result<TypeId, PoolError>

Returns actual type id of the node.
Source§

fn actual_type_name( &self, handle: Handle<<UserInterface as SceneGraph>::Node>, ) -> Result<&'static str, PoolError>

Returns actual type name of the node.
Source§

fn derived_type_ids( &self, handle: Handle<<UserInterface as SceneGraph>::Node>, ) -> Result<Vec<TypeId>, PoolError>

Returns a list of derived type ids of the node.
Source§

fn root(&self) -> Handle<<UserInterface as SceneGraph>::Node>

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

fn set_root(&mut self, root: Handle<<UserInterface as SceneGraph>::Node>)

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

fn try_get_node( &self, handle: Handle<<UserInterface as SceneGraph>::Node>, ) -> Result<&<UserInterface as SceneGraph>::Node, PoolError>

Tries to borrow a node, returns Ok(node) if the handle is valid, Err(…) - otherwise.
Source§

fn try_get_node_mut( &mut self, handle: Handle<<UserInterface as SceneGraph>::Node>, ) -> Result<&mut <UserInterface as SceneGraph>::Node, PoolError>

Tries to borrow a node, returns Ok(node) if the handle is valid, Err(…) - otherwise.
Source§

fn is_valid_handle( &self, handle: Handle<impl ObjectOrVariant<<UserInterface as SceneGraph>::Node>>, ) -> bool

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

fn add_node( &mut self, node: <UserInterface as SceneGraph>::Node, ) -> Handle<<UserInterface as SceneGraph>::Node>

Adds a new node to the graph.
Source§

fn add_node_at_handle( &mut self, node: <UserInterface as SceneGraph>::Node, node_handle: Handle<<UserInterface as SceneGraph>::Node>, )

Adds a new node to the graph at the given handle.
Source§

fn remove_node( &mut self, node: Handle<impl ObjectOrVariant<<UserInterface as SceneGraph>::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<impl ObjectOrVariant<<UserInterface as SceneGraph>::Node>>, )

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

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

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

fn linear_iter( &self, ) -> impl Iterator<Item = &<UserInterface as SceneGraph>::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 <UserInterface as SceneGraph>::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<U>(&self, handle: Handle<U>) -> Result<&U, PoolError>

Tries to borrow a graph node by the given handle. This method accepts both type-agnostic container (read - Self::Node) handles and the actual node type handles. For example, if the container type is Node (holds Box<dyn NodeTrait>) and there’s a SpecificNode (implements the NodeTrait), then this method can accept both Handle<Node> and Handle<SpecificNode>. Internally, this method will try to downcast the container to the specified type (which may fail). Read more
Source§

fn try_get_mut<U>(&mut self, handle: Handle<U>) -> Result<&mut U, PoolError>

Tries to borrow a graph node by the given handle. This method accepts both type-agnostic container (read - Self::Node) handles and the actual node type handles. For example, if the container type is Node (holds Box<dyn NodeTrait>) and there’s a SpecificNode (implements the NodeTrait), then this method can accept both Handle<Node> and Handle<SpecificNode>. Internally, this method will try to downcast the container to the specified type (which may fail). Read more
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 try_get_node_by_uuid(&self, uuid: Uuid) -> Option<&Self::Node>

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

fn try_get_node_by_uuid_mut(&mut self, uuid: Uuid) -> Option<&mut Self::Node>

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

fn change_hierarchy_root( &mut self, prev_root: Handle<impl ObjectOrVariant<Self::Node>>, new_root: Handle<impl ObjectOrVariant<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<impl ObjectOrVariant<Self::Node>>])

Removes all the nodes from the given slice.
Source§

fn try_get_of_type<T>( &self, handle: Handle<Self::Node>, ) -> Result<&T, PoolError>
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>, ) -> Result<&mut T, PoolError>
where T: 'static,

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

fn has_component<T>( &self, handle: Handle<impl ObjectOrVariant<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<impl ObjectOrVariant<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<impl ObjectOrVariant<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<impl ObjectOrVariant<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<impl ObjectOrVariant<Self::Node>>, ) -> Option<(Handle<Self::Node>, &T)>
where T: 'static,

Source§

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

Source§

fn find_up_map<C, T>( &self, root_node: Handle<impl ObjectOrVariant<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<impl ObjectOrVariant<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<impl ObjectOrVariant<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<impl ObjectOrVariant<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<impl ObjectOrVariant<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<impl ObjectOrVariant<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<impl ObjectOrVariant<Self::Node>>, ) -> impl Iterator<Item = (Handle<Self::Node>, &Self::Node)>

Create a graph depth traversal iterator.
Source§

fn traverse_handle_iter( &self, from: Handle<impl ObjectOrVariant<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 UserInterfaceTestingExtension for UserInterface

Source§

fn click( &mut self, position: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>, )

Clicks at the given position.
Source§

fn click_at(&mut self, uuid: Uuid) -> Handle<UiNode>

Tries to find a widget with the given unique id and clicks at its center.
Source§

fn click_at_text(&mut self, uuid: Uuid, text: &str)

Source§

fn click_at_count_response<M>(&mut self, uuid: Uuid, response: M) -> usize

Source§

fn find_by_uuid(&self, uuid: Uuid) -> Option<&UiNode>

Source§

fn find_by_uuid_of<T>(&self, uuid: Uuid) -> Option<&T>
where T: Control,

Source§

fn poll_all_messages(&mut self)

Source§

fn poll_and_count(&mut self, pred: impl FnMut(&UiMessage) -> bool) -> usize

Source§

fn type_text(&mut self, text: &str)

Source§

fn is_visible(&self, uuid: Uuid) -> bool

Source§

impl Visit for UserInterface

Source§

fn visit(&mut self, name: &str, visitor: &mut Visitor) -> Result<(), VisitError>

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 into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

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

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

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

Converts &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)

Converts &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> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DynType for T

Source§

fn type_uuid(&self) -> Uuid

Source§

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

Source§

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

Source§

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

Source§

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

Casts self to a &dyn Any
Source§

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

Casts self to a &mut dyn Any
Source§

fn field_value_as_reflect(&self) -> &(dyn Reflect + 'static)

Source§

fn field_value_as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)

Source§

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

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<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T, U> ObjectOrVariant<T> for U

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<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
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 + Default + TypeUuidProvider + Send + 'static,

Source§

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

Source§

impl<T> TypedResourceData for T