bevy/crates/bevy_render/src/render_graph/edge.rs
2020-04-24 17:57:20 -07:00

31 lines
725 B
Rust

use super::NodeId;
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum Edge {
SlotEdge {
input_node: NodeId,
input_index: usize,
output_node: NodeId,
output_index: usize,
},
NodeEdge {
input_node: NodeId,
output_node: NodeId,
},
}
impl Edge {
pub fn get_input_node(&self) -> NodeId {
match self {
Edge::SlotEdge { input_node, .. } => *input_node,
Edge::NodeEdge { input_node, .. } => *input_node,
}
}
pub fn get_output_node(&self) -> NodeId {
match self {
Edge::SlotEdge { output_node, .. } => *output_node,
Edge::NodeEdge { output_node, .. } => *output_node,
}
}
}