pub struct EdgeBuilder<'a> {
pub source: String,
pub source_port_position: Option<PortPosition>,
pub target: String,
pub target_port_position: Option<PortPosition>,
/* private fields */
}Fields§
§source: String§source_port_position: Option<PortPosition>§target: String§target_port_position: Option<PortPosition>Implementations§
Source§impl<'a> EdgeBuilder<'a>
impl<'a> EdgeBuilder<'a>
pub fn new<S: Into<String>, T: Into<String>>(source: S, target: T) -> Self
pub fn new_with_port_position<S: Into<String>, T: Into<String>>( source: S, source_port_position: PortPosition, target: T, target_port_position: PortPosition, ) -> Self
pub fn source_port_position(&mut self, port_position: PortPosition) -> &mut Self
pub fn target_port_position(&mut self, port_position: PortPosition) -> &mut Self
Sourcepub fn add_attribute<S: Into<String>>(
&mut self,
key: S,
value: AttributeText<'a>,
) -> &mut Self
pub fn add_attribute<S: Into<String>>( &mut self, key: S, value: AttributeText<'a>, ) -> &mut Self
Add an attribute to the edge.
Sourcepub fn add_attributes(
&'a mut self,
attributes: HashMap<String, AttributeText<'a>>,
) -> &mut Self
pub fn add_attributes( &'a mut self, attributes: HashMap<String, AttributeText<'a>>, ) -> &mut Self
Add multiple attributes to the edge.
pub fn build(&self) -> ValidationResult<Edge<'a>>
pub fn build_ignore_validation(&self) -> Edge<'a>
Trait Implementations§
Source§impl<'a> EdgeAttributes<'a> for EdgeBuilder<'a>
impl<'a> EdgeAttributes<'a> for EdgeBuilder<'a>
fn add_attribute<S: Into<String>>( &mut self, key: S, value: AttributeText<'a>, ) -> &mut Self
fn get_attributes_mut(&mut self) -> &mut IndexMap<String, AttributeText<'a>>
fn add_validation_error(&mut self, field: &'static str, message: &'static str)
Source§fn arrow_head(&mut self, arrowhead: ArrowType) -> &mut Self
fn arrow_head(&mut self, arrowhead: ArrowType) -> &mut Self
Style of arrowhead on the head node of an edge.
This will only appear if the dir attribute is forward or both.
Source§fn arrow_size(&mut self, arrow_size: f32) -> &mut Self
fn arrow_size(&mut self, arrow_size: f32) -> &mut Self
Multiplicative scale factor for arrowheads.
default: 1.0, minimum: 0.0
Source§fn arrow_tail(&mut self, arrow_tail: ArrowType) -> &mut Self
fn arrow_tail(&mut self, arrow_tail: ArrowType) -> &mut Self
Style of arrowhead on the tail node of an edge.
This will only appear if the dir attribute is back or both.
Source§fn class(&mut self, class: String) -> &mut Self
fn class(&mut self, class: String) -> &mut Self
Classnames to attach to the edge’s SVG element.
Combine with stylesheet for styling SVG output using CSS classnames.
Multiple space-separated classes are supported.
Source§fn color(&mut self, color: Color<'a>) -> &mut Self
fn color(&mut self, color: Color<'a>) -> &mut Self
Basic drawing color for graphics, not text. For the latter, use the fontcolor attribute.
If any fraction is used, the colors are drawn in series, with each color being given
roughly its specified fraction of the edge.
Source§fn color_with_colorlist(&mut self, color: ColorList<'a>) -> &mut Self
fn color_with_colorlist(&mut self, color: ColorList<'a>) -> &mut Self
Basic drawing color for graphics, not text. For the latter, use the fontcolor attribute.
if colorList has no fractions, the edge is drawn using parallel splines or lines,
one for each color in the list, in the order given.
The head arrow, if any, is drawn using the first color in the list, and the tail
arrow, if any, the second color. This supports the common case of drawing opposing edges,
but using parallel splines instead of separately routed multiedges.
If any fraction is used, the colors are drawn in series, with each color being given
roughly its specified fraction of the edge.
Source§fn color_scheme(&mut self, color_scheme: String) -> &mut Self
fn color_scheme(&mut self, color_scheme: String) -> &mut Self
This attribute specifies a color scheme namespace: the context for interpreting color names.
In particular, if a color value has form “xxx” or “//xxx”, then the color xxx will be evaluated
according to the current color scheme. If no color scheme is set, the standard X11 naming is used.
For example, if colorscheme=bugn9, then color=7 is interpreted as color=“/bugn9/7”.
Source§fn comment(&mut self, comment: String) -> &mut Self
fn comment(&mut self, comment: String) -> &mut Self
Comments are inserted into output. Device-dependent
Source§fn constraint(&mut self, constraint: bool) -> &mut Self
fn constraint(&mut self, constraint: bool) -> &mut Self
If false, the edge is not used in ranking the nodes.
Source§fn decorate(&mut self, decorate: bool) -> &mut Self
fn decorate(&mut self, decorate: bool) -> &mut Self
If true, attach edge label to edge by a 2-segment polyline, underlining the label,
then going to the closest point of spline.
Source§fn dir(&mut self, dir: Direction) -> &mut Self
fn dir(&mut self, dir: Direction) -> &mut Self
Edge type for drawing arrowheads.
Indicates which ends of the edge should be decorated with an arrowhead.
The actual style of the arrowhead can be specified using the arrowhead
and arrowtail attributes.
Source§fn edge_target(&mut self, edge_target: String) -> &mut Self
fn edge_target(&mut self, edge_target: String) -> &mut Self
If the edge has a URL or edgeURL attribute, edgetarget determines which window
of the browser is used for the URL attached to the non-label part of the edge.
Setting edgetarget=_graphviz will open a new window if it doesn’t already exist,
or reuse it if it does.
Source§fn edge_tooltip(&mut self, edge_tooltip: String) -> &mut Self
fn edge_tooltip(&mut self, edge_tooltip: String) -> &mut Self
Tooltip annotation attached to the non-label part of an edge.
Used only if the edge has a URL or edgeURL attribute.
Source§fn edge_url(&mut self, edge_url: String) -> &mut Self
fn edge_url(&mut self, edge_url: String) -> &mut Self
The link for the non-label parts of an edge.
edgeURL overrides any URL defined for the edge.
Also, edgeURL is used near the head or tail node unless overridden by
headURL or tailURL, respectively.
Source§fn fill_color(&mut self, fill_color: Color<'a>) -> &mut Self
fn fill_color(&mut self, fill_color: Color<'a>) -> &mut Self
Color used to fill the background of a node or cluster assuming
style=filled, or a filled arrowhead.
Source§fn fill_color_with_colorlist(&mut self, fill_color: ColorList<'a>) -> &mut Self
fn fill_color_with_colorlist(&mut self, fill_color: ColorList<'a>) -> &mut Self
Color used to fill the background of a node or cluster assuming
style=filled, or a filled arrowhead.
A gradient fill is used. By default, this is a linear fill; setting style=radial
will cause a radial fill.
At present, only two colors are used. If the second color (after a colon) is missing,
the default color is used for it.
Source§fn font_color(&mut self, font_color: Color<'a>) -> &mut Self
fn font_color(&mut self, font_color: Color<'a>) -> &mut Self
Color used for text.
Source§fn font_size(&mut self, font_size: f32) -> &mut Self
fn font_size(&mut self, font_size: f32) -> &mut Self
Font size, in points, used for text.
default: 14.0, minimum: 1.0
Source§fn head_lp(&mut self, head_lp: Point) -> &mut Self
fn head_lp(&mut self, head_lp: Point) -> &mut Self
Position of an edge’s head label, in points. The position indicates the center of the label.
Source§fn head_clip(&mut self, head_clip: bool) -> &mut Self
fn head_clip(&mut self, head_clip: bool) -> &mut Self
If true, the head of an edge is clipped to the boundary of the head node;
otherwise, the end of the edge goes to the center of the node, or the center
of a port, if applicable.
Source§fn head_label(&mut self, head_label: String) -> &mut Self
fn head_label(&mut self, head_label: String) -> &mut Self
Text label to be placed near head of edge.
Source§fn head_port(&mut self, head_port: PortPosition) -> &mut Self
fn head_port(&mut self, head_port: PortPosition) -> &mut Self
Indicates where on the head node to attach the head of the edge.
In the default case, the edge is aimed towards the center of the node,
and then clipped at the node boundary.
Source§fn head_target(&mut self, head_target: String) -> &mut Self
fn head_target(&mut self, head_target: String) -> &mut Self
If the edge has a headURL, headtarget determines which window of the browser is used for the URL.
Setting headURL=_graphviz will open a new window if the window doesn’t already exist,
or reuse the window if it does.
If undefined, the value of the target is used.
Source§fn head_tooltip(&mut self, head_tooltip: String) -> &mut Self
fn head_tooltip(&mut self, head_tooltip: String) -> &mut Self
Tooltip annotation attached to the head of an edge.
Used only if the edge has a headURL attribute.
Source§fn head_url(&mut self, head_url: String) -> &mut Self
fn head_url(&mut self, head_url: String) -> &mut Self
If defined, headURL is output as part of the head label of the edge.
Also, this value is used near the head node, overriding any URL value.
Source§fn label_angle(&mut self, label_angle: f32) -> &mut Self
fn label_angle(&mut self, label_angle: f32) -> &mut Self
Determines, along with labeldistance, where the headlabel / taillabel are
placed with respect to the head / tail in polar coordinates.
The origin in the coordinate system is the point where the edge touches the node.
The ray of 0 degrees goes from the origin back along the edge, parallel to the edge at the origin.
The angle, in degrees, specifies the rotation from the 0 degree ray,
with positive angles moving counterclockwise and negative angles moving clockwise.
default: -25.0, minimum: -180.0
Source§fn label_distance(&mut self, label_distance: f32) -> &mut Self
fn label_distance(&mut self, label_distance: f32) -> &mut Self
Multiplicative scaling factor adjusting the distance that the headlabel / taillabel is from
the head / tail node.
default: 1.0, minimum: 0.0
Source§fn label_float(&mut self, label_float: bool) -> &mut Self
fn label_float(&mut self, label_float: bool) -> &mut Self
If true, allows edge labels to be less constrained in position.
In particular, it may appear on top of other edges.
Source§fn label_font_color(&mut self, label_font_color: Color<'a>) -> &mut Self
fn label_font_color(&mut self, label_font_color: Color<'a>) -> &mut Self
Color used for headlabel and taillabel.
Source§fn label_font_name(&mut self, label_font_name: String) -> &mut Self
fn label_font_name(&mut self, label_font_name: String) -> &mut Self
Font used for headlabel and taillabel.
If not set, defaults to edge’s fontname.
Source§fn label_font_size(&mut self, label_font_size: f32) -> &mut Self
fn label_font_size(&mut self, label_font_size: f32) -> &mut Self
Font size, in points, used for headlabel and taillabel.
If not set, defaults to edge’s fontsize.
default: 14.0, minimum: 1.0
Source§fn label_target(&mut self, label_target: String) -> &mut Self
fn label_target(&mut self, label_target: String) -> &mut Self
If the edge has a URL or labelURL attribute, this attribute determines
which window of the browser is used for the URL attached to the label.
Source§fn label_tooltip(&mut self, label_tooltip: String) -> &mut Self
fn label_tooltip(&mut self, label_tooltip: String) -> &mut Self
Tooltip annotation attached to label of an edge.
Used only if the edge has a URL or labelURL attribute.
Source§fn label_url(&mut self, label_url: String) -> &mut Self
fn label_url(&mut self, label_url: String) -> &mut Self
If defined, labelURL is the link used for the label of an edge.
labelURL overrides any URL defined for the edge.
fn layer(&mut self, layer: String) -> &mut Self
fn lhead(&mut self, lhead: String) -> &mut Self
Source§fn label_position(&mut self, lp: Point) -> &mut Self
fn label_position(&mut self, lp: Point) -> &mut Self
Label position
The position indicates the center of the label.
Source§fn ltail(&mut self, ltail: String) -> &mut Self
fn ltail(&mut self, ltail: String) -> &mut Self
Logical tail of an edge.
When compound=true, if ltail is defined and is the name of a cluster
containing the real tail, the edge is clipped to the boundary of the cluster.
Source§fn min_len(&mut self, min_len: u32) -> &mut Self
fn min_len(&mut self, min_len: u32) -> &mut Self
Minimum edge length (rank difference between head and tail).
fn no_justify(&mut self, no_justify: bool) -> &mut Self
fn pen_width(&mut self, pen_width: f32) -> &mut Self
Source§fn pos(&mut self, pos: Point) -> &mut Self
fn pos(&mut self, pos: Point) -> &mut Self
Position of node, or spline control points.
the position indicates the center of the node. On output, the coordinates are in points.
Source§fn same_head(&mut self, same_head: String) -> &mut Self
fn same_head(&mut self, same_head: String) -> &mut Self
Edges with the same head and the same samehead value are aimed at the same point on the head.
Source§fn same_tail(&mut self, same_tail: String) -> &mut Self
fn same_tail(&mut self, same_tail: String) -> &mut Self
Edges with the same tail and the same sametail value are aimed at the same point on the tail.
Source§fn show_boxes(&mut self, show_boxes: u32) -> &mut Self
fn show_boxes(&mut self, show_boxes: u32) -> &mut Self
Print guide boxes in PostScript at the beginning of routesplines if showboxes=1, or at the
end if showboxes=2.
(Debugging, TB mode only!)
default: 0, minimum: 0
Source§fn style(&mut self, style: EdgeStyle) -> &mut Self
fn style(&mut self, style: EdgeStyle) -> &mut Self
Set style information for components of the graph.
Source§fn tail_lp(&mut self, tail_lp: Point) -> &mut Self
fn tail_lp(&mut self, tail_lp: Point) -> &mut Self
Position of an edge’s tail label, in points.
The position indicates the center of the label.
Source§fn tail_clip(&mut self, tail_clip: bool) -> &mut Self
fn tail_clip(&mut self, tail_clip: bool) -> &mut Self
If true, the tail of an edge is clipped to the boundary of the tail node; otherwise,
the end of the edge goes to the center of the node, or the center of a port, if applicable.
Source§fn tail_label(&mut self, tail_label: String) -> &mut Self
fn tail_label(&mut self, tail_label: String) -> &mut Self
Text label to be placed near tail of edge.
Source§fn tail_port(&mut self, tail_port: PortPosition) -> &mut Self
fn tail_port(&mut self, tail_port: PortPosition) -> &mut Self
Indicates where on the tail node to attach the tail of the edge.
Source§fn tail_target(&mut self, tail_target: String) -> &mut Self
fn tail_target(&mut self, tail_target: String) -> &mut Self
If the edge has a tailURL, tailtarget determines which window of the browser is used for the URL.
Source§fn tail_tooltip(&mut self, tail_tooltip: String) -> &mut Self
fn tail_tooltip(&mut self, tail_tooltip: String) -> &mut Self
Tooltip annotation attached to the tail of an edge.
Source§fn tail_url(&mut self, tail_url: String) -> &mut Self
fn tail_url(&mut self, tail_url: String) -> &mut Self
If defined, tailURL is output as part of the tail label of the edge.
Also, this value is used near the tail node, overriding any URL value.
Source§fn target(&mut self, target: String) -> &mut Self
fn target(&mut self, target: String) -> &mut Self
If the object has a URL, this attribute determines which window of the browser is used for the URL.
Source§fn tooltip(&mut self, tooltip: String) -> &mut Self
fn tooltip(&mut self, tooltip: String) -> &mut Self
Tooltip annotation attached to the node or edge.
If unset, Graphviz will use the object’s label if defined.
Note that if the label is a record specification or an HTML-like label,
the resulting tooltip may be unhelpful.
In this case, if tooltips will be generated, the user should set a tooltip attribute explicitly.
Source§fn url(&mut self, url: String) -> &mut Self
fn url(&mut self, url: String) -> &mut Self
Hyperlinks incorporated into device-dependent output.
Source§fn weight(&mut self, weight: u32) -> &mut Self
fn weight(&mut self, weight: u32) -> &mut Self
Weight of edge.
The heavier the weight, the shorter, straighter and more vertical the edge is.
default: 1, minimum: 0
Source§fn xlabel(&mut self, xlabel: String) -> &mut Self
fn xlabel(&mut self, xlabel: String) -> &mut Self
External label for a node or edge.
The label will be placed outside of the node but near it.
These labels are added after all nodes and edges have been placed.
The labels will be placed so that they do not overlap any node or label.
This means it may not be possible to place all of them.
To force placing all of them, set forcelabels=true.
Auto Trait Implementations§
impl<'a> Freeze for EdgeBuilder<'a>
impl<'a> RefUnwindSafe for EdgeBuilder<'a>
impl<'a> Send for EdgeBuilder<'a>
impl<'a> Sync for EdgeBuilder<'a>
impl<'a> Unpin for EdgeBuilder<'a>
impl<'a> UnsafeUnpin for EdgeBuilder<'a>
impl<'a> UnwindSafe for EdgeBuilder<'a>
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