maplibre/render/graph/
mod.rs

1pub use context::*;
2pub use edge::*;
3pub use graph::*;
4pub use node::*;
5pub use node_slot::*;
6use thiserror::Error;
7
8mod context;
9mod edge;
10mod graph;
11mod node;
12mod node_slot;
13
14#[derive(Error, Debug, Eq, PartialEq)]
15pub enum RenderGraphError {
16    #[error("node does not exist")]
17    InvalidNode(NodeLabel),
18    #[error("output node slot does not exist")]
19    InvalidOutputNodeSlot(SlotLabel),
20    #[error("input node slot does not exist")]
21    InvalidInputNodeSlot(SlotLabel),
22    #[error("node does not match the given type")]
23    WrongNodeType,
24    #[error("attempted to connect a node output slot to an incompatible input node slot")]
25    MismatchedNodeSlots {
26        output_node: NodeId,
27        output_slot: usize,
28        input_node: NodeId,
29        input_slot: usize,
30    },
31    #[error("attempted to add an edge that already exists")]
32    EdgeAlreadyExists(Edge),
33    #[error("attempted to remove an edge that does not exist")]
34    EdgeDoesNotExist(Edge),
35    #[error("node has an unconnected input slot")]
36    UnconnectedNodeInputSlot { node: NodeId, input_slot: usize },
37    #[error("node has an unconnected output slot")]
38    UnconnectedNodeOutputSlot { node: NodeId, output_slot: usize },
39    #[error("node input slot already occupied")]
40    NodeInputSlotAlreadyOccupied {
41        node: NodeId,
42        input_slot: usize,
43        occupied_by_node: NodeId,
44    },
45}