pub struct NodeSchema {
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 ports: Vec<PortDecl>,
pub default_data: Value,
}Expand description
Schema for a node kind.
Fields§
§kind: NodeKindKeyCanonical kind key.
latest_kind_version: u32Latest schema version for this kind.
kind_aliases: Vec<NodeKindKey>Kind aliases (renames).
title: StringUI-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.
ports: Vec<PortDecl>Declared ports.
default_data: ValueDefault node payload.
Implementations§
Source§impl NodeSchema
impl NodeSchema
Sourcepub fn instantiate(&self, pos: CanvasPoint) -> NodeInstantiation
pub fn instantiate(&self, pos: CanvasPoint) -> NodeInstantiation
Instantiates a node and its declared ports with freshly allocated ids.
Sourcepub fn instantiate_with_ids(
&self,
node_id: NodeId,
pos: CanvasPoint,
port_ids: impl IntoIterator<Item = PortId>,
) -> Result<NodeInstantiation, NodeInstantiationError>
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
impl Clone for NodeSchema
Source§fn clone(&self) -> NodeSchema
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NodeSchema
impl Debug for NodeSchema
Source§impl<'de> Deserialize<'de> for NodeSchema
impl<'de> Deserialize<'de> for NodeSchema
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for NodeSchema
impl RefUnwindSafe for NodeSchema
impl Send for NodeSchema
impl Sync for NodeSchema
impl Unpin for NodeSchema
impl UnsafeUnpin for NodeSchema
impl UnwindSafe for NodeSchema
Blanket Implementations§
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
Mutably borrows from an owned value. Read more