bevy/crates/bevy_render/src/render_graph/edge.rs

32 lines
725 B
Rust
Raw Normal View History

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,
}
}
}