pub trait Labeller<'a, N, E> {
Show 20 methods
// Required methods
fn graph_id(&'a self) -> Id<'a>;
fn node_id(&'a self, n: &N) -> Id<'a>;
// Provided methods
fn graph_attrs(&'a self) -> HashMap<&str, &str> { ... }
fn node_shape(&'a self, _node: &N) -> Option<LabelText<'a>> { ... }
fn node_label(&'a self, n: &N) -> LabelText<'a> { ... }
fn edge_label(&'a self, e: &E) -> LabelText<'a> { ... }
fn node_style(&'a self, _n: &N) -> Style { ... }
fn rank_dir(&'a self) -> Option<RankDir> { ... }
fn node_color(&'a self, _node: &N) -> Option<LabelText<'a>> { ... }
fn node_attrs(&'a self, _n: &N) -> HashMap<&str, &str> { ... }
fn edge_end_arrow(&'a self, _e: &E) -> Arrow { ... }
fn edge_start_arrow(&'a self, _e: &E) -> Arrow { ... }
fn edge_style(&'a self, _e: &E) -> Style { ... }
fn edge_color(&'a self, _e: &E) -> Option<LabelText<'a>> { ... }
fn edge_attrs(&'a self, _e: &E) -> HashMap<&str, &str> { ... }
fn kind(&self) -> Kind { ... }
fn edge_start_point(&'a self, _e: &E) -> Option<CompassPoint> { ... }
fn edge_end_point(&'a self, _e: &E) -> Option<CompassPoint> { ... }
fn edge_start_port(&'a self, _: &E) -> Option<Id<'a>> { ... }
fn edge_end_port(&'a self, _: &E) -> Option<Id<'a>> { ... }
}Expand description
Each instance of a type that implements Label<C> maps to a
unique identifier with respect to C, which is used to identify
it in the generated .dot file. They can also provide more
elaborate (and non-unique) label text that is used in the graphviz
rendered output.
The graph instance is responsible for providing the DOT compatible
identifiers for the nodes and (optionally) rendered labels for the nodes and
edges, as well as an identifier for the graph itself.
Required Methods§
Provided Methods§
Sourcefn graph_attrs(&'a self) -> HashMap<&str, &str>
fn graph_attrs(&'a self) -> HashMap<&str, &str>
A list of attributes to apply to the graph
Sourcefn node_shape(&'a self, _node: &N) -> Option<LabelText<'a>>
fn node_shape(&'a self, _node: &N) -> Option<LabelText<'a>>
Maps n to one of the graphviz shape names. If None
is returned, no shape attribute is specified.
Sourcefn node_label(&'a self, n: &N) -> LabelText<'a>
fn node_label(&'a self, n: &N) -> LabelText<'a>
Maps n to a label that will be used in the rendered output.
The label need not be unique, and may be the empty string; the
default is just the output from node_id.
Sourcefn edge_label(&'a self, e: &E) -> LabelText<'a>
fn edge_label(&'a self, e: &E) -> LabelText<'a>
Maps e to a label that will be used in the rendered output.
The label need not be unique, and may be the empty string; the
default is in fact the empty string.
Sourcefn node_style(&'a self, _n: &N) -> Style
fn node_style(&'a self, _n: &N) -> Style
Maps n to a style that will be used in the rendered output.
Sourcefn rank_dir(&'a self) -> Option<RankDir>
fn rank_dir(&'a self) -> Option<RankDir>
Return an explicit rank dir to use for directed graphs.
Return ‘None’ to use the default (generally “TB” for directed graphs).
Sourcefn node_color(&'a self, _node: &N) -> Option<LabelText<'a>>
fn node_color(&'a self, _node: &N) -> Option<LabelText<'a>>
Maps n to one of the graphviz color names. If None
is returned, no color attribute is specified.
Sourcefn node_attrs(&'a self, _n: &N) -> HashMap<&str, &str>
fn node_attrs(&'a self, _n: &N) -> HashMap<&str, &str>
Maps n to a set of arbritrary node attributes.
Sourcefn edge_end_arrow(&'a self, _e: &E) -> Arrow
fn edge_end_arrow(&'a self, _e: &E) -> Arrow
Maps e to arrow style that will be used on the end of an edge.
Defaults to default arrow style.
Sourcefn edge_start_arrow(&'a self, _e: &E) -> Arrow
fn edge_start_arrow(&'a self, _e: &E) -> Arrow
Maps e to arrow style that will be used on the end of an edge.
Defaults to default arrow style.
Sourcefn edge_style(&'a self, _e: &E) -> Style
fn edge_style(&'a self, _e: &E) -> Style
Maps e to a style that will be used in the rendered output.
Sourcefn edge_color(&'a self, _e: &E) -> Option<LabelText<'a>>
fn edge_color(&'a self, _e: &E) -> Option<LabelText<'a>>
Maps e to one of the graphviz color names. If None
is returned, no color attribute is specified.
Sourcefn edge_attrs(&'a self, _e: &E) -> HashMap<&str, &str>
fn edge_attrs(&'a self, _e: &E) -> HashMap<&str, &str>
Maps e to a set of arbritrary edge attributes.
Sourcefn edge_start_point(&'a self, _e: &E) -> Option<CompassPoint>
fn edge_start_point(&'a self, _e: &E) -> Option<CompassPoint>
Maps e to the compass point that the edge will start from.
Defaults to the default point
Sourcefn edge_end_point(&'a self, _e: &E) -> Option<CompassPoint>
fn edge_end_point(&'a self, _e: &E) -> Option<CompassPoint>
Maps e to the compass point that the edge will end at.
Defaults to the default point
Sourcefn edge_start_port(&'a self, _: &E) -> Option<Id<'a>>
fn edge_start_port(&'a self, _: &E) -> Option<Id<'a>>
Maps e to the port that the edge will start from.
Sourcefn edge_end_port(&'a self, _: &E) -> Option<Id<'a>>
fn edge_end_port(&'a self, _: &E) -> Option<Id<'a>>
Maps e to the port that the edge will end at.