Trait graphviz::Labeller
[−]
[src]
pub trait Labeller<'a> { type Node; type Edge; fn graph_id(&'a self) -> Id<'a>; fn node_id(&'a self, n: &Self::Node) -> Id<'a>; fn node_shape(&'a self, _node: &Self::Node) -> Option<LabelText<'a>> { ... } fn node_label(&'a self, n: &Self::Node) -> LabelText<'a> { ... } fn edge_label(&'a self, e: &Self::Edge) -> LabelText<'a> { ... } fn node_style(&'a self, _n: &Self::Node) -> Style { ... } fn edge_style(&'a self, _e: &Self::Edge) -> Style { ... } }
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
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.
Associated Types
type Node
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
type Edge
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Required Methods
fn graph_id(&'a self) -> Id<'a>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Must return a DOT compatible identifier naming the graph.
fn node_id(&'a self, n: &Self::Node) -> Id<'a>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Maps n
to a unique identifier with respect to self
. The
implementor is responsible for ensuring that the returned name
is a valid DOT identifier.
Provided Methods
fn node_shape(&'a self, _node: &Self::Node) -> Option<LabelText<'a>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Maps n
to one of the graphviz shape
names. If None
is returned, no shape
attribute is specified.
fn node_label(&'a self, n: &Self::Node) -> LabelText<'a>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
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
.
fn edge_label(&'a self, e: &Self::Edge) -> LabelText<'a>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
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.
fn node_style(&'a self, _n: &Self::Node) -> Style
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Maps n
to a style that will be used in the rendered output.
fn edge_style(&'a self, _e: &Self::Edge) -> Style
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Maps e
to a style that will be used in the rendered output.