pub trait GraphModel {
// Required methods
fn nodes(&self) -> Vec<Node>;
fn edges(&self) -> Vec<Edge>;
// Provided methods
fn groups(&self) -> Vec<Group> { ... }
fn params(&self, _node: &str) -> Vec<Param> { ... }
fn kinds(&self) -> Vec<Kind> { ... }
fn can_connect(
&self,
from: (&Node, &Port),
to: (&Node, &Port),
) -> Result<(), Refusal> { ... }
}Expand description
The graph, as the application keeps it. The editor reads it each
frame and never changes it: what the user does comes back as
Edits for the application to apply.