pub trait NodeDefinition: Sized {
type TypeInfo: NodeTypeInfo;
// Required methods
fn node_label(&self, registry: &Registry) -> String;
fn node_pins_in(&self, registry: &Registry) -> Vec<NodePin<Self::TypeInfo>>;
fn node_pins_out(&self, registry: &Registry) -> Vec<NodePin<Self::TypeInfo>>;
fn node_is_start(&self, registry: &Registry) -> bool;
fn node_suggestions(
x: i64,
y: i64,
suggestion: NodeSuggestion<'_, Self>,
registry: &Registry,
) -> Vec<ResponseSuggestionNode<Self>>;
// Provided methods
fn validate_connection(
&self,
source: &Self,
registry: &Registry,
) -> Result<(), Box<dyn Error>> { ... }
fn get_property(&self, name: &str) -> Option<PropertyValue> { ... }
fn set_property(&mut self, name: &str, value: PropertyValue) { ... }
}
Required Associated Types§
type TypeInfo: NodeTypeInfo
Required Methods§
fn node_label(&self, registry: &Registry) -> String
fn node_pins_in(&self, registry: &Registry) -> Vec<NodePin<Self::TypeInfo>>
fn node_pins_out(&self, registry: &Registry) -> Vec<NodePin<Self::TypeInfo>>
fn node_is_start(&self, registry: &Registry) -> bool
fn node_suggestions( x: i64, y: i64, suggestion: NodeSuggestion<'_, Self>, registry: &Registry, ) -> Vec<ResponseSuggestionNode<Self>>
Provided Methods§
fn validate_connection( &self, source: &Self, registry: &Registry, ) -> Result<(), Box<dyn Error>>
fn get_property(&self, name: &str) -> Option<PropertyValue>
fn set_property(&mut self, name: &str, value: PropertyValue)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.