Skip to main content

GraphRowShape

Struct GraphRowShape 

Source
pub struct GraphRowShape<N> {
Show 13 fields pub node: N, pub merge: bool, pub separator_line: bool, pub style: GraphRowShapeStyle, pub is_head: bool, pub is_root: bool, pub node_column: usize, pub parent_columns: Vec<usize>, pub node_line: Vec<NodeLine>, pub link_line: Option<Vec<LinkLine>>, pub term_line: Option<Vec<bool>>, pub ancestry_line: Vec<PadLine>, pub line_ids: Option<Box<GraphRowLineIds>>,
}
Expand description

An abstract graph row shape for one rendered node.

This is the output of the graph-to-rows stage. It captures the node’s current column, the edge shape around it, and any row-level facts needed by later stages. It intentionally does not contain glyphs or message text.

Example of different type of lines, depending on the rendering style, certain lines can be skipped or repeated:

  │                            // pre_node_line() (optional, repeatable)
  │                            // pre_node_line()
  o      F                     // node_line (mandory, once)
  │      very long message 0   // post_node_line() (optional, repeatable)
  │      very long message 0   // post_node_line()
  ├─┬─╮  very long message 1   // link_line (mandory, once)
  │ │ ~  very long message 2   // term_line (mandory, once)
  : │    very long message 3   // ancestry_line (mandory, once or repeatable)
  │ │    very long message 4   // post_ancestry_line() (optional, repeatable)
  │ │    very long message 5   // post_ancestry_line()

Fields§

§node: N

The node represented by this row.

§merge: bool

True if this row connects to multiple parents.

Some prefix renderers use this to choose clearer junction glyphs.

§separator_line: bool

True if this row needs a blank separator before its graph lines.

§style: GraphRowShapeStyle

Style used to produce this row shape.

§is_head: bool

True if this node is a head (no children, uses a new column).

§is_root: bool

True if this node has no parents.

§node_column: usize

The column containing the node glyph.

§parent_columns: Vec<usize>

The columns occupied by this node’s parents.

§node_line: Vec<NodeLine>

Abstract columns for the line containing the node.

§link_line: Option<Vec<LinkLine>>

Abstract columns for the line connecting the node to its parents.

This is absent when the node and its parents can be represented without an explicit link line.

§term_line: Option<Vec<bool>>

Terminator columns for anonymous parents.

A true entry marks a column where the edge should terminate. Other columns should be rendered using the row’s padding columns.

§ancestry_line: Vec<PadLine>

Abstract columns for ancestry continuation below this row.

§line_ids: Option<Box<GraphRowLineIds>>

Optional line identities for graph coloring.

Implementations§

Source§

impl<N> GraphRowShape<N>

Source

pub fn has_indirect_ancestor(&self) -> bool

True if the ancestry line contains an indirect ancestor edge.

Source

pub fn pre_node_line(&self) -> Vec<PadLine>

Derive the repeatable padding line before the node line.

Source

pub fn post_node_line(&self) -> Vec<PadLine>

Derive the repeatable padding line after the node line.

Source

pub fn post_ancestry_line(&self) -> Vec<PadLine>

Derive the repeatable padding line after the ancestry line.

Trait Implementations§

Source§

impl<N: Clone> Clone for GraphRowShape<N>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<N: Debug> Debug for GraphRowShape<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<N: Eq> Eq for GraphRowShape<N>

Source§

impl<N: PartialEq> PartialEq for GraphRowShape<N>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<N: PartialEq> StructuralPartialEq for GraphRowShape<N>

Auto Trait Implementations§

§

impl<N> Forget for GraphRowShape<N>

§

impl<N> Freeze for GraphRowShape<N>
where N: Freeze,

§

impl<N> Move for GraphRowShape<N>

§

impl<N> RefUnwindSafe for GraphRowShape<N>
where N: RefUnwindSafe,

§

impl<N> Send for GraphRowShape<N>
where N: Send,

§

impl<N> Sync for GraphRowShape<N>
where N: Sync,

§

impl<N> Unpin for GraphRowShape<N>
where N: Unpin,

§

impl<N> UnsafeUnpin for GraphRowShape<N>
where N: UnsafeUnpin,

§

impl<N> UnwindSafe for GraphRowShape<N>
where N: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.