#[non_exhaustive]pub enum SubgraphBorder {
Double,
Light,
Dashed,
None,
}Expand description
Subgraph (cluster) box border style.
None is not “invisible cluster” — the box still groups its nodes
for layout and its label still paints; only the border ink is
suppressed.
use ascii_dag::{Graph, RenderOptions};
use ascii_dag::render::engine::{SubgraphBorder, SubgraphStyle, SubgraphStyleCtx};
fn borderless(_ctx: SubgraphStyleCtx<'_>) -> SubgraphStyle {
SubgraphStyle { border: SubgraphBorder::None, ..SubgraphStyle::default() }
}
let mut g = Graph::new();
g.add_node(1, "A");
g.add_node(2, "B");
g.add_edge(1, 2, None);
let sg = g.add_subgraph("Group");
g.put_nodes(&[1]).inside(sg).unwrap();
let mut options = RenderOptions::plain();
options.plan.subgraph_style_fn = borderless;
let text = g.compute_layout().render_string(&options);
assert!(!text.contains('╔')); // no border ink
assert!(text.contains("Group")); // label still thereVariants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Double
Double strokes (═ ║) — the default (legacy).
Light
Light strokes (─ │).
Dashed
Dashed strokes (┈ ┊).
None
No border — the cluster groups its nodes without ink (its label still paints when it fits).
Trait Implementations§
Source§impl Clone for SubgraphBorder
impl Clone for SubgraphBorder
Source§fn clone(&self) -> SubgraphBorder
fn clone(&self) -> SubgraphBorder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SubgraphBorder
Source§impl Debug for SubgraphBorder
impl Debug for SubgraphBorder
Source§impl Default for SubgraphBorder
impl Default for SubgraphBorder
Source§fn default() -> SubgraphBorder
fn default() -> SubgraphBorder
Returns the “default value” for a type. Read more
impl Eq for SubgraphBorder
Source§impl PartialEq for SubgraphBorder
impl PartialEq for SubgraphBorder
impl StructuralPartialEq for SubgraphBorder
Auto Trait Implementations§
impl Freeze for SubgraphBorder
impl RefUnwindSafe for SubgraphBorder
impl Send for SubgraphBorder
impl Sync for SubgraphBorder
impl Unpin for SubgraphBorder
impl UnsafeUnpin for SubgraphBorder
impl UnwindSafe for SubgraphBorder
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