pub struct DataflowGraph {
pub operators: Vec<DfOperator>,
pub channels: Vec<Channel>,
pub inputs: Vec<ChannelId>,
pub outputs: Vec<ChannelId>,
pub energy_estimates: HashMap<OperatorId, EnergyEstimate>,
pub name: Option<String>,
}Expand description
A complete dataflow graph
Fields§
§operators: Vec<DfOperator>All operators in the graph
channels: Vec<Channel>All channels
inputs: Vec<ChannelId>External input channels (fed from outside)
outputs: Vec<ChannelId>External output channels (results)
energy_estimates: HashMap<OperatorId, EnergyEstimate>Energy estimates per operator
name: Option<String>Name/label for debugging
Implementations§
Source§impl DataflowGraph
impl DataflowGraph
Sourcepub fn add_operator(&mut self, op: DfOperator) -> OperatorId
pub fn add_operator(&mut self, op: DfOperator) -> OperatorId
Add an operator and return its ID
Sourcepub fn add_channel(&mut self, token_type: TokenType) -> ChannelId
pub fn add_channel(&mut self, token_type: TokenType) -> ChannelId
Add a channel and return its ID
Sourcepub fn add_channel_with_capacity(
&mut self,
token_type: TokenType,
capacity: usize,
) -> ChannelId
pub fn add_channel_with_capacity( &mut self, token_type: TokenType, capacity: usize, ) -> ChannelId
Add a channel with specified capacity
Sourcepub fn add_output(&mut self, channel: ChannelId)
pub fn add_output(&mut self, channel: ChannelId)
Mark a channel as external output
Sourcepub fn total_energy_estimate(&self) -> f64
pub fn total_energy_estimate(&self) -> f64
Get total estimated energy for the graph
Sourcepub fn operator_counts(&self) -> HashMap<&'static str, usize>
pub fn operator_counts(&self) -> HashMap<&'static str, usize>
Get operator count by type
Trait Implementations§
Source§impl Clone for DataflowGraph
impl Clone for DataflowGraph
Source§fn clone(&self) -> DataflowGraph
fn clone(&self) -> DataflowGraph
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DataflowGraph
impl Debug for DataflowGraph
Source§impl Default for DataflowGraph
impl Default for DataflowGraph
Auto Trait Implementations§
impl Freeze for DataflowGraph
impl RefUnwindSafe for DataflowGraph
impl Send for DataflowGraph
impl Sync for DataflowGraph
impl Unpin for DataflowGraph
impl UnwindSafe for DataflowGraph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more