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 link_line_from_node: Option<Vec<LinkLine>>, pub term_line: Option<Vec<bool>>, pub ancestry_line: Vec<PadLine>,
}
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.

§link_line_from_node: Option<Vec<LinkLine>>

The part of link_line that is directly emitted from this row’s node.

For example:

  │ o   // node line
  ├─╯   // link line

The link_line_from_node LinkLine looks like:

  ╭─╯

Note “├” is changed to “╭”.

Consumers can use this to follow or highlight edges that originate from the current node without guessing from the full 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.

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 for GraphRowShape<N>
where N: Clone,

Source§

fn clone(&self) -> GraphRowShape<N>

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 for GraphRowShape<N>
where N: Debug,

Source§

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

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

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

Source§

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

Source§

fn eq(&self, other: &GraphRowShape<N>) -> bool

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

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

Inequality operator !=. Read more
Source§

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

Auto Trait Implementations§

§

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

§

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> TryClone for T
where T: Clone,

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more