Skip to main content

WidgetConstructor

Type Alias WidgetConstructor 

Source
pub type WidgetConstructor = GraphNodeConstructor<UiNode, UserInterface>;
Expand description

Node constructor.

Aliased Type§

pub struct WidgetConstructor {
    pub default: Arc<dyn Fn() -> UiNode + Send + Sync>,
    pub variants: Vec<Variant<UiNode, UserInterface>>,
    pub group: &'static str,
    pub assembly_name: &'static str,
}

Fields§

§default: Arc<dyn Fn() -> UiNode + Send + Sync>

A boxed type constructor that returns a node in default state. This constructor is used at deserialization stage.

§variants: Vec<Variant<UiNode, UserInterface>>

A set of node constructors that returns specific variants of the same node type. Could be used to pre-define specific variations of nodes, for example a Mesh node could have different surfaces (sphere, cube, cone, etc.). It is used by the editor, this collection must have at least one item to be shown in the editor.

§group: &'static str

Name of the group the type belongs to.

§assembly_name: &'static str

A name of the assembly this node constructor is from.