intuicio_nodes::nodes

Trait NodeDefinition

Source
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§

Required Methods§

Source

fn node_label(&self, registry: &Registry) -> String

Source

fn node_pins_in(&self, registry: &Registry) -> Vec<NodePin<Self::TypeInfo>>

Source

fn node_pins_out(&self, registry: &Registry) -> Vec<NodePin<Self::TypeInfo>>

Source

fn node_is_start(&self, registry: &Registry) -> bool

Source

fn node_suggestions( x: i64, y: i64, suggestion: NodeSuggestion<'_, Self>, registry: &Registry, ) -> Vec<ResponseSuggestionNode<Self>>

Provided Methods§

Source

fn validate_connection( &self, source: &Self, registry: &Registry, ) -> Result<(), Box<dyn Error>>

Source

fn get_property(&self, name: &str) -> Option<PropertyValue>

Source

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.

Implementors§