pub trait HydroGraphWrite {
type Err: Error;
// Required methods
fn write_prologue(&mut self) -> Result<(), Self::Err>;
fn write_node_definition(
&mut self,
node_id: usize,
node_label: &NodeLabel,
node_type: HydroNodeType,
location_id: Option<usize>,
location_type: Option<&str>,
) -> Result<(), Self::Err>;
fn write_edge(
&mut self,
src_id: usize,
dst_id: usize,
edge_type: HydroEdgeType,
label: Option<&str>,
) -> Result<(), Self::Err>;
fn write_location_start(
&mut self,
location_id: usize,
location_type: &str,
) -> Result<(), Self::Err>;
fn write_node(&mut self, node_id: usize) -> Result<(), Self::Err>;
fn write_location_end(&mut self) -> Result<(), Self::Err>;
fn write_epilogue(&mut self) -> Result<(), Self::Err>;
}
Expand description
Trait for writing textual representations of Hydro IR graphs, i.e. mermaid or dot graphs.
Required Associated Types§
Required Methods§
Sourcefn write_prologue(&mut self) -> Result<(), Self::Err>
fn write_prologue(&mut self) -> Result<(), Self::Err>
Begin the graph. First method called.
Sourcefn write_node_definition(
&mut self,
node_id: usize,
node_label: &NodeLabel,
node_type: HydroNodeType,
location_id: Option<usize>,
location_type: Option<&str>,
) -> Result<(), Self::Err>
fn write_node_definition( &mut self, node_id: usize, node_label: &NodeLabel, node_type: HydroNodeType, location_id: Option<usize>, location_type: Option<&str>, ) -> Result<(), Self::Err>
Write a node definition with styling.
Sourcefn write_edge(
&mut self,
src_id: usize,
dst_id: usize,
edge_type: HydroEdgeType,
label: Option<&str>,
) -> Result<(), Self::Err>
fn write_edge( &mut self, src_id: usize, dst_id: usize, edge_type: HydroEdgeType, label: Option<&str>, ) -> Result<(), Self::Err>
Write an edge between nodes with optional labeling.
Sourcefn write_location_start(
&mut self,
location_id: usize,
location_type: &str,
) -> Result<(), Self::Err>
fn write_location_start( &mut self, location_id: usize, location_type: &str, ) -> Result<(), Self::Err>
Begin writing a location grouping (process/cluster).
Sourcefn write_node(&mut self, node_id: usize) -> Result<(), Self::Err>
fn write_node(&mut self, node_id: usize) -> Result<(), Self::Err>
Write a node within a location.
Sourcefn write_location_end(&mut self) -> Result<(), Self::Err>
fn write_location_end(&mut self) -> Result<(), Self::Err>
End writing a location grouping.
Sourcefn write_epilogue(&mut self) -> Result<(), Self::Err>
fn write_epilogue(&mut self) -> Result<(), Self::Err>
End the graph. Last method called.