Skip to main content

NodeSchema

Struct NodeSchema 

Source
pub struct NodeSchema {
Show 18 fields pub kind: NodeKindKey, pub latest_kind_version: u32, pub kind_aliases: Vec<NodeKindKey>, pub title: String, pub category: Vec<String>, pub keywords: Vec<String>, pub renderer_key: Option<String>, pub default_size: Option<CanvasSize>, pub layout_budget: NodeSurfaceLayoutBudget, pub ports: Vec<PortDecl>, pub surface_slots: Vec<NodeSurfaceSlotDescriptor>, pub repeatable_collections: Vec<NodeRepeatableCollectionDescriptor>, pub actions: Vec<NodeActionDescriptor>, pub menus: Vec<MenuDescriptor>, pub inspectors: Vec<InspectorDescriptor>, pub blackboards: Vec<BlackboardDescriptor>, pub chrome: Vec<NodeChromeDescriptor>, pub default_data: Value,
}
Expand description

Schema for a node kind.

Fields§

§kind: NodeKindKey

Canonical kind key.

§latest_kind_version: u32

Latest schema version for this kind.

§kind_aliases: Vec<NodeKindKey>

Kind aliases (renames).

§title: String

UI-facing title.

§category: Vec<String>

Category path (for create-node search/palette).

§keywords: Vec<String>

Search keywords.

§renderer_key: Option<String>

Adapter-facing renderer key.

Runtime keeps this as data instead of a component reference so React, Svelte, native, and future adapters can map the key to their own renderer registry.

§default_size: Option<CanvasSize>

Default logical node size for adapters that need an initial rect before measurement.

§layout_budget: NodeSurfaceLayoutBudget

Semantic readable-surface budget for adapter-local node internals.

§ports: Vec<PortDecl>

Declared ports.

§surface_slots: Vec<NodeSurfaceSlotDescriptor>

Renderer-neutral semantic slots for rich adapter node surfaces.

§repeatable_collections: Vec<NodeRepeatableCollectionDescriptor>

Renderer-neutral dynamic row/list descriptors for node-local authoring surfaces.

§actions: Vec<NodeActionDescriptor>

Renderer-neutral action descriptors for node-local authoring surfaces.

§menus: Vec<MenuDescriptor>

Renderer-neutral menu descriptors. Adapters own popup widgets and state.

§inspectors: Vec<InspectorDescriptor>

Renderer-neutral inspector descriptors. Adapters own panel widgets and focus.

§blackboards: Vec<BlackboardDescriptor>

Graph-level property lists exposed as adapter-local blackboard panels.

§chrome: Vec<NodeChromeDescriptor>

Renderer-neutral semantic chrome around rich adapter node surfaces.

§default_data: Value

Default node payload.

Implementations§

Source§

impl NodeSchema

Source

pub fn builder( kind: impl Into<NodeKindKey>, title: impl Into<String>, ) -> NodeSchemaBuilder

Starts a node schema builder with renderer-neutral defaults.

Source

pub fn instantiate(&self, pos: CanvasPoint) -> NodeInstantiation

Instantiates a node and its declared ports with freshly allocated ids.

Source

pub fn instantiate_with_ids( &self, node_id: NodeId, pos: CanvasPoint, port_ids: impl IntoIterator<Item = PortId>, ) -> Result<NodeInstantiation, NodeInstantiationError>

Instantiates a node and its declared ports with caller-provided ids.

Trait Implementations§

Source§

impl Clone for NodeSchema

Source§

fn clone(&self) -> NodeSchema

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for NodeSchema

Source§

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

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

impl<'de> Deserialize<'de> for NodeSchema

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<NodeSchemaBuilder> for NodeSchema

Source§

fn from(value: NodeSchemaBuilder) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for NodeSchema

Source§

fn eq(&self, other: &NodeSchema) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for NodeSchema

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for NodeSchema

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> 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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.