pub trait HydroGraphWrite {
type Err: Error;
// Required methods
fn write_prologue(&mut self) -> Result<(), Self::Err>;
fn write_node_definition(
&mut self,
node_id: VizNodeKey,
node_label: &NodeLabel,
node_type: HydroNodeType,
location_key: Option<LocationKey>,
location_type: Option<LocationType>,
backtrace: Option<&Backtrace>,
) -> Result<(), Self::Err>;
fn write_edge(
&mut self,
src_id: VizNodeKey,
dst_id: VizNodeKey,
edge_properties: &HashSet<HydroEdgeProp>,
label: Option<&str>,
) -> Result<(), Self::Err>;
fn write_location_start(
&mut self,
location_key: LocationKey,
location_type: LocationType,
) -> Result<(), Self::Err>;
fn write_node(&mut self, node_id: VizNodeKey) -> Result<(), Self::Err>;
fn write_location_end(&mut self) -> Result<(), Self::Err>;
fn write_epilogue(&mut self) -> Result<(), Self::Err>;
}Available on crate feature
viz only.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: VizNodeKey,
node_label: &NodeLabel,
node_type: HydroNodeType,
location_key: Option<LocationKey>,
location_type: Option<LocationType>,
backtrace: Option<&Backtrace>,
) -> Result<(), Self::Err>
fn write_node_definition( &mut self, node_id: VizNodeKey, node_label: &NodeLabel, node_type: HydroNodeType, location_key: Option<LocationKey>, location_type: Option<LocationType>, backtrace: Option<&Backtrace>, ) -> Result<(), Self::Err>
Write a node definition with styling.
Sourcefn write_edge(
&mut self,
src_id: VizNodeKey,
dst_id: VizNodeKey,
edge_properties: &HashSet<HydroEdgeProp>,
label: Option<&str>,
) -> Result<(), Self::Err>
fn write_edge( &mut self, src_id: VizNodeKey, dst_id: VizNodeKey, edge_properties: &HashSet<HydroEdgeProp>, label: Option<&str>, ) -> Result<(), Self::Err>
Write an edge between nodes with optional labeling.
Sourcefn write_location_start(
&mut self,
location_key: LocationKey,
location_type: LocationType,
) -> Result<(), Self::Err>
fn write_location_start( &mut self, location_key: LocationKey, location_type: LocationType, ) -> Result<(), Self::Err>
Begin writing a location grouping (process/cluster).
Sourcefn write_node(&mut self, node_id: VizNodeKey) -> Result<(), Self::Err>
fn write_node(&mut self, node_id: VizNodeKey) -> 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.