Debian Codegraph @

src/render.rs

raw symbols SCIP
1 /*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::collectionsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/::BTreeMaprust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/btree/map/BTreeMap#;
9 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::opsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/::Rangerust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#;
10
11 use bitflagsrust-analyzer cargo bitflags 1.3.2 crate/::bitflagsrust-analyzer cargo bitflags 1.3.2 bitflags!;
12 #[cfg(feature = "serialize")]
13 use serderust-analyzer cargo serde 1.0.229 crate/::Serializerust-analyzer cargo serde_core 1.0.229 ser/Serialize#;
14
15 use superrust-analyzer cargo esl01-renderdag 0.3.0 crate/::columnrust-analyzer cargo esl01-renderdag 0.3.0 column/::Columnrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#;
16 use superrust-analyzer cargo esl01-renderdag 0.3.0 crate/::columnrust-analyzer cargo esl01-renderdag 0.3.0 column/::ColumnsExtrust-analyzer cargo esl01-renderdag 0.3.0 column/ColumnsExt#;
17 use superrust-analyzer cargo esl01-renderdag 0.3.0 crate/::outputrust-analyzer cargo esl01-renderdag 0.3.0 output/::OutputRendererBuilderrust-analyzer cargo esl01-renderdag 0.3.0 output/OutputRendererBuilder#;
18
19 pub trait Rendererrust-analyzer cargo esl01-renderdag 0.3.0 render/Renderer#<N> {
20 type Outputrust-analyzer cargo esl01-renderdag 0.3.0 render/Renderer#Output#;
21
22 // Returns the width of the graph line, possibly including another node.
23 fn widthrust-analyzer cargo esl01-renderdag 0.3.0 render/Renderer#width().(&self, new_node: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&N>, new_parents: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#<N>>>) -> u64;
24
25 // Reserve a column for the given node.
26 fn reserverust-analyzer cargo esl01-renderdag 0.3.0 render/Renderer#reserve().(&mut self, node: N);
27
28 // Render the next row.
29 fn next_rowrust-analyzer cargo esl01-renderdag 0.3.0 render/Renderer#next_row().(
30 &mut self,
31 node: N,
32 parents: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#<N>>,
33 glyph: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#,
34 message: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#,
35 ) -> Self::Outputrust-analyzer cargo esl01-renderdag 0.3.0 render/Renderer#Output#;
36 }
37
38 /// Renderer for a DAG.
39 ///
40 /// Converts a sequence of DAG node descriptions into rendered graph rows.
41 pub struct GraphRowRendererrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#<N> {
42 columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns.: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Columnrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#<N>>,
43 }
44
45 /// Ancestor type indication for an ancestor or parent node.
46 pub enum Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#<N> {
47 /// The node is an eventual ancestor.
48 Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#Ancestor#(N),
49
50 /// The node is an immediate parent.
51 Parentrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#Parent#(N),
52
53 /// The node is an anonymous ancestor.
54 Anonymousrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#Anonymous#,
55 }
56
57 impl<N> Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#<N> {
58 fn to_columnrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`Ancestor<N>`]to_column().(&self) -> Columnrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#<N>
59 where
60 N: Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#,
61 {
62 match self {
63 Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#::Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#Ancestor#(n) => Columnrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#::Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#Ancestor#(n.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().()),
64 Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#::Parentrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#Parent#(n) => Columnrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#::Parentrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#Parent#(n.clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#clone().()),
65 Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#::Anonymousrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#Anonymous# => Columnrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#::Blockedrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#Blocked#,
66 }
67 }
68
69 fn idrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`Ancestor<N>`]id().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&N> {
70 match self {
71 Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#::Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#Ancestor#(n) => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(&n),
72 Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#::Parentrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#Parent#(n) => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(&n),
73 Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#::Anonymousrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#Anonymous# => Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#,
74 }
75 }
76
77 fn is_directrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`Ancestor<N>`]is_direct().(&self) -> bool {
78 match self {
79 Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#::Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#Ancestor#(_) => false,
80 Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#::Parentrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#Parent#(_) => true,
81 Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#::Anonymousrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#Anonymous# => true,
82 }
83 }
84
85 fn to_link_linerust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`Ancestor<N>`]to_link_line().(&self, direct: LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#, indirect: LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#) -> LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine# {
86 if self.is_directrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`Ancestor<N>`]is_direct().() { direct } else { indirect }
87 }
88 }
89
90 struct AncestorColumnBoundsrust-analyzer cargo esl01-renderdag 0.3.0 render/AncestorColumnBounds# {
91 targetrust-analyzer cargo esl01-renderdag 0.3.0 render/AncestorColumnBounds#target.: usize,
92 min_ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/AncestorColumnBounds#min_ancestor.: usize,
93 min_parentrust-analyzer cargo esl01-renderdag 0.3.0 render/AncestorColumnBounds#min_parent.: usize,
94 max_parentrust-analyzer cargo esl01-renderdag 0.3.0 render/AncestorColumnBounds#max_parent.: usize,
95 max_ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/AncestorColumnBounds#max_ancestor.: usize,
96 }
97
98 impl AncestorColumnBoundsrust-analyzer cargo esl01-renderdag 0.3.0 render/AncestorColumnBounds# {
99 fn newrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[AncestorColumnBounds]new().<N>(columns: &BTreeMaprust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/btree/map/BTreeMap#<usize, &Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#<N>>, target: usize) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Selfrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[AncestorColumnBounds]> {
100 if columns.is_emptyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/btree/map/impl#[`BTreeMap<K, V, A>`]is_empty().() {
101 return Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#;
102 }
103 let min_ancestor = columns
104 .iterrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/btree/map/impl#[`BTreeMap<K, V, A>`]iter().()
105 .nextrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/btree/map/impl#[`Iter<'a, K, V>`][Iterator]next().()
106 .map_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map_or().(target, |(index, _)| *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().index)
107 .minrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord#min().(target);
108 let max_ancestor = columns
109 .iterrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/btree/map/impl#[`BTreeMap<K, V, A>`]iter().()
110 .next_backrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/btree/map/impl#[`Iter<'a, K, V>`][DoubleEndedIterator]next_back().()
111 .map_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map_or().(target, |(index, _)| *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().index)
112 .maxrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord#max().(target);
113 let min_parent = columns
114 .iterrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/btree/map/impl#[`BTreeMap<K, V, A>`]iter().()
115 .findrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#find().(|(_, ancestor)| ancestor.is_directrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`Ancestor<N>`]is_direct().())
116 .map_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map_or().(target, |(index, _)| *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().index)
117 .minrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord#min().(target);
118 let max_parent = columns
119 .iterrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/btree/map/impl#[`BTreeMap<K, V, A>`]iter().()
120 .revrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#rev().()
121 .findrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/rev/impl#[`Rev<I>`][Iterator]find().(|(_, ancestor)| ancestor.is_directrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`Ancestor<N>`]is_direct().())
122 .map_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map_or().(target, |(index, _)| *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().index)
123 .maxrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord#max().(target);
124 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Selfrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[AncestorColumnBounds] {
125 targetrust-analyzer cargo esl01-renderdag 0.3.0 render/AncestorColumnBounds#target.,
126 min_ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/AncestorColumnBounds#min_ancestor.,
127 min_parentrust-analyzer cargo esl01-renderdag 0.3.0 render/AncestorColumnBounds#min_parent.,
128 max_parentrust-analyzer cargo esl01-renderdag 0.3.0 render/AncestorColumnBounds#max_parent.,
129 max_ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/AncestorColumnBounds#max_ancestor.,
130 })
131 }
132
133 fn rangerust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[AncestorColumnBounds]range().(&self) -> Rangerust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#<usize> {
134 if self.min_ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/AncestorColumnBounds#min_ancestor. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().self.max_ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/AncestorColumnBounds#max_ancestor. {
135 self.min_ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/AncestorColumnBounds#min_ancestor. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().1..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#self.max_ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/AncestorColumnBounds#max_ancestor.
136 } else {
137 Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default#::defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/impl#[`Range<Idx>`][Default]default().()
138 }
139 }
140
141 fn horizontal_linerust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[AncestorColumnBounds]horizontal_line().(&self, index: usize) -> LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine# {
142 if index rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().self.targetrust-analyzer cargo esl01-renderdag 0.3.0 render/AncestorColumnBounds#target. {
143 LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::emptyrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]empty().()
144 } else if index rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().self.min_parentrust-analyzer cargo esl01-renderdag 0.3.0 render/AncestorColumnBounds#min_parent. && index rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().self.max_parentrust-analyzer cargo esl01-renderdag 0.3.0 render/AncestorColumnBounds#max_parent. {
145 LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::HORIZ_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]HORIZ_PARENT.
146 } else if index rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().self.min_ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/AncestorColumnBounds#min_ancestor. && index rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().self.max_ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/AncestorColumnBounds#max_ancestor. {
147 LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::HORIZ_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]HORIZ_ANCESTOR.
148 } else {
149 LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::emptyrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]empty().()
150 }
151 }
152 }
153
154 impl<N> Columnrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#<N> {
155 fn to_node_linerust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`Column<N>`]to_node_line().(&self) -> NodeLinerust-analyzer cargo esl01-renderdag 0.3.0 render/NodeLine# {
156 match self {
157 Columnrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#::Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#Ancestor#(_) => NodeLinerust-analyzer cargo esl01-renderdag 0.3.0 render/NodeLine#::Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/NodeLine#Ancestor#,
158 Columnrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#::Parentrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#Parent#(_) => NodeLinerust-analyzer cargo esl01-renderdag 0.3.0 render/NodeLine#::Parentrust-analyzer cargo esl01-renderdag 0.3.0 render/NodeLine#Parent#,
159 _ => NodeLinerust-analyzer cargo esl01-renderdag 0.3.0 render/NodeLine#::Blankrust-analyzer cargo esl01-renderdag 0.3.0 render/NodeLine#Blank#,
160 }
161 }
162
163 fn to_link_linerust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`Column<N>`]to_link_line().(&self) -> LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine# {
164 match self {
165 Columnrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#::Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#Ancestor#(_) => LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::VERT_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]VERT_ANCESTOR.,
166 Columnrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#::Parentrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#Parent#(_) => LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::VERT_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]VERT_PARENT.,
167 _ => LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::emptyrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]empty().(),
168 }
169 }
170
171 fn to_pad_linerust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`Column<N>`]to_pad_line().(&self) -> PadLinerust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine# {
172 match self {
173 Columnrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#::Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#Ancestor#(_) => PadLinerust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#::Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#Ancestor#,
174 Columnrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#::Parentrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#Parent#(_) => PadLinerust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#::Parentrust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#Parent#,
175 _ => PadLinerust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#::Blankrust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#Blank#,
176 }
177 }
178 }
179
180 /// A column in the node row.
181 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:)]
182 #[cfg_attr(feature = "serialize", derive(Serializerust-analyzer cargo serde_derive 1.0.229 Serialize:))]
183 pub enum NodeLinerust-analyzer cargo esl01-renderdag 0.3.0 render/NodeLine# {
184 /// Blank.
185 Blankrust-analyzer cargo esl01-renderdag 0.3.0 render/NodeLine#Blank#,
186
187 /// Vertical line indicating an ancestor.
188 Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/NodeLine#Ancestor#,
189
190 /// Vertical line indicating a parent.
191 Parentrust-analyzer cargo esl01-renderdag 0.3.0 render/NodeLine#Parent#,
192
193 /// The node for this row.
194 Noderust-analyzer cargo esl01-renderdag 0.3.0 render/NodeLine#Node#,
195 }
196
197 /// A column in a padding row.
198 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:)]
199 #[cfg_attr(feature = "serialize", derive(Serializerust-analyzer cargo serde_derive 1.0.229 Serialize:))]
200 pub enum PadLinerust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine# {
201 /// Blank.
202 Blankrust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#Blank#,
203
204 /// Vertical line indicating an ancestor.
205 Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#Ancestor#,
206
207 /// Vertical line indicating a parent.
208 Parentrust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#Parent#,
209 }
210
211 bitflagsrust-analyzer cargo bitflags 1.3.2 bitflags!! {
212 /// A column in a linking row.
213 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:)]
214 #[cfg_attr(feature = "serialize", derive(Serializerust-analyzer cargo serde_derive 1.0.229 Serialize:))]
215 pub struct LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#: u16 {
216 /// This cell contains a horizontal line that connects to a parent.
217 const HORIZ_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/__BitFlags#HORIZ_PARENT(). = 0b0_0000_0000_0001;
218
219 /// This cell contains a horizontal line that connects to an ancestor.
220 const HORIZ_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/__BitFlags#HORIZ_ANCESTOR(). = 0b0_0000_0000_0010;
221
222 /// The descendent of this cell is connected to the parent.
223 const VERT_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/__BitFlags#VERT_PARENT(). = 0b0_0000_0000_0100;
224
225 /// The descendent of this cell is connected to an ancestor.
226 const VERT_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/__BitFlags#VERT_ANCESTOR(). = 0b0_0000_0000_1000;
227
228 /// The parent of this cell is linked in this link row and the child
229 /// is to the left.
230 const LEFT_FORK_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/__BitFlags#LEFT_FORK_PARENT(). = 0b0_0000_0001_0000;
231
232 /// The ancestor of this cell is linked in this link row and the child
233 /// is to the left.
234 const LEFT_FORK_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/__BitFlags#LEFT_FORK_ANCESTOR(). = 0b0_0000_0010_0000;
235
236 /// The parent of this cell is linked in this link row and the child
237 /// is to the right.
238 const RIGHT_FORK_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/__BitFlags#RIGHT_FORK_PARENT(). = 0b0_0000_0100_0000;
239
240 /// The ancestor of this cell is linked in this link row and the child
241 /// is to the right.
242 const RIGHT_FORK_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/__BitFlags#RIGHT_FORK_ANCESTOR(). = 0b0_0000_1000_0000;
243
244 /// The child of this cell is linked to parents on the left.
245 const LEFT_MERGE_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/__BitFlags#LEFT_MERGE_PARENT(). = 0b0_0001_0000_0000;
246
247 /// The child of this cell is linked to ancestors on the left.
248 const LEFT_MERGE_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/__BitFlags#LEFT_MERGE_ANCESTOR(). = 0b0_0010_0000_0000;
249
250 /// The child of this cell is linked to parents on the right.
251 const RIGHT_MERGE_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/__BitFlags#RIGHT_MERGE_PARENT(). = 0b0_0100_0000_0000;
252
253 /// The child of this cell is linked to ancestors on the right.
254 const RIGHT_MERGE_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/__BitFlags#RIGHT_MERGE_ANCESTOR(). = 0b0_1000_0000_0000;
255
256 /// The target node of this link line is the child of this column.
257 /// This disambiguates between the node that is connected in this link
258 /// line, and other nodes that are also connected vertically.
259 const CHILDrust-analyzer cargo esl01-renderdag 0.3.0 render/__BitFlags#CHILD(). = 0b1_0000_0000_0000;
260
261 const HORIZONTALrust-analyzer cargo esl01-renderdag 0.3.0 render/__BitFlags#HORIZONTAL(). = Selfrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]::HORIZ_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]HORIZ_PARENT..bitsrust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#bits. |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor(). Selfrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]::HORIZ_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]HORIZ_ANCESTOR..bitsrust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#bits.;
262 const VERTICALrust-analyzer cargo esl01-renderdag 0.3.0 render/__BitFlags#VERTICAL(). = Selfrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]::VERT_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]VERT_PARENT..bitsrust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#bits. |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor(). Selfrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]::VERT_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]VERT_ANCESTOR..bitsrust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#bits.;
263 const LEFT_FORKrust-analyzer cargo esl01-renderdag 0.3.0 render/__BitFlags#LEFT_FORK(). = Selfrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]::LEFT_FORK_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]LEFT_FORK_PARENT..bitsrust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#bits. |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor(). Selfrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]::LEFT_FORK_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]LEFT_FORK_ANCESTOR..bitsrust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#bits.;
264 const RIGHT_FORKrust-analyzer cargo esl01-renderdag 0.3.0 render/__BitFlags#RIGHT_FORK(). = Selfrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]::RIGHT_FORK_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]RIGHT_FORK_PARENT..bitsrust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#bits. |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor(). Selfrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]::RIGHT_FORK_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]RIGHT_FORK_ANCESTOR..bitsrust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#bits.;
265 const LEFT_MERGErust-analyzer cargo esl01-renderdag 0.3.0 render/__BitFlags#LEFT_MERGE(). = Selfrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]::LEFT_MERGE_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]LEFT_MERGE_PARENT..bitsrust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#bits. |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor(). Selfrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]::LEFT_MERGE_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]LEFT_MERGE_ANCESTOR..bitsrust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#bits.;
266 const RIGHT_MERGErust-analyzer cargo esl01-renderdag 0.3.0 render/__BitFlags#RIGHT_MERGE(). = Selfrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]::RIGHT_MERGE_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]RIGHT_MERGE_PARENT..bitsrust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#bits. |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor(). Selfrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]::RIGHT_MERGE_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]RIGHT_MERGE_ANCESTOR..bitsrust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#bits.;
267 const ANY_MERGErust-analyzer cargo esl01-renderdag 0.3.0 render/__BitFlags#ANY_MERGE(). = Selfrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]::LEFT_MERGErust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]LEFT_MERGE..bitsrust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#bits. |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor(). Selfrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]::RIGHT_MERGErust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]RIGHT_MERGE..bitsrust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#bits.;
268 const ANY_FORKrust-analyzer cargo esl01-renderdag 0.3.0 render/__BitFlags#ANY_FORK(). = Selfrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]::LEFT_FORKrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]LEFT_FORK..bitsrust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#bits. |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor(). Selfrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]::RIGHT_FORKrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]RIGHT_FORK..bitsrust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#bits.;
269 const ANY_FORK_OR_MERGErust-analyzer cargo esl01-renderdag 0.3.0 render/__BitFlags#ANY_FORK_OR_MERGE(). = Selfrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]::ANY_MERGErust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]ANY_MERGE..bitsrust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#bits. |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitOr<Self>`]bitor(). Selfrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]::ANY_FORKrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]ANY_FORK..bitsrust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#bits.;
270 }
271 }
272
273 /// An output graph row.
274 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:)]
275 #[cfg_attr(feature = "serialize", derive(Serializerust-analyzer cargo serde_derive 1.0.229 Serialize:))]
276 pub struct GraphRowrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#<N> {
277 /// The name of the node for this row.
278 pub noderust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#node.: N,
279
280 /// The glyph for this node.
281 pub glyphrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#glyph.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#,
282
283 /// The message for this row.
284 pub messagerust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#message.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#,
285
286 /// True if this row is for a merge commit.
287 pub mergerust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#merge.: bool,
288
289 /// The node columns for this row.
290 pub node_linerust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#node_line.: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<NodeLinerust-analyzer cargo esl01-renderdag 0.3.0 render/NodeLine#>,
291
292 /// The link columns for this row, if a link row is necessary.
293 pub link_linerust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#link_line.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#>>,
294
295 /// The location of any terminators, if necessary. Other columns should be
296 /// filled in with pad lines.
297 pub term_linerust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#term_line.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<bool>>,
298
299 /// The pad columns for this row.
300 pub pad_linesrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#pad_lines.: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<PadLinerust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#>,
301 }
302
303 impl<N> GraphRowRendererrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#<N>
304 where
305 N: Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone# + Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq#,
306 {
307 /// Create a new renderer.
308 pub fn newrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`GraphRowRenderer<N>`]new().() -> Selfrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`GraphRowRenderer<N>`] {
309 GraphRowRendererrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer# {
310 columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns.: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(),
311 }
312 }
313
314 /// Build an output renderer from this renderer.
315 pub fn outputrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`GraphRowRenderer<N>`]output().(self) -> OutputRendererBuilderrust-analyzer cargo esl01-renderdag 0.3.0 output/OutputRendererBuilder#<N, Selfrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`GraphRowRenderer<N>`]> {
316 OutputRendererBuilderrust-analyzer cargo esl01-renderdag 0.3.0 output/OutputRendererBuilder#::newrust-analyzer cargo esl01-renderdag 0.3.0 output/impl#[`OutputRendererBuilder<N, R>`]new().(self)
317 }
318 }
319
320 impl<N> Rendererrust-analyzer cargo esl01-renderdag 0.3.0 render/Renderer#<N> for GraphRowRendererrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#<N>
321 where
322 N: Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone# + Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq#,
323 {
324 type Outputrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`GraphRowRenderer<N>`][`Renderer<N>`]Output# = GraphRowrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#<N>;
325
326 fn widthrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`GraphRowRenderer<N>`][`Renderer<N>`]width().(&self, node: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&N>, parents: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#<N>>>) -> u64 {
327 let mut width = self.columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns..lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().();
328 let mut empty_columns = self
329 .columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns.
330 .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().()
331 .filterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#filter().(|&column| column rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq().&Columnrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#::Emptyrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#Empty#)
332 .countrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/filter/impl#[`Filter<I, P>`][Iterator]count().();
333 if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(node) = node {
334 // If the node is not already allocated, and there is no
335 // space for the node, then adding the new node would create
336 // a new column.
337 if self.columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns..findrust-analyzer cargo esl01-renderdag 0.3.0 column/impl#[`Vec<Column<N>>`][`ColumnsExt<N>`]find().(&node).is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().() {
338 if empty_columns rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().0 {
339 width rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1;
340 } else {
341 empty_columns = empty_columns.saturating_subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[usize]saturating_sub().(1);
342 }
343 }
344 }
345 if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(parents) = parents {
346 // Non-allocated parents will also need a new column (except
347 // for one, which can take the place of the node, and any that could be allocated to
348 // empty columns).
349 let unallocated_parents = parents
350 .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().()
351 .filterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#filter().(|parent| {
352 parent
353 .idrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`Ancestor<N>`]id().()
354 .map_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map_or().(true, |parent| self.columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns..findrust-analyzer cargo esl01-renderdag 0.3.0 column/impl#[`Vec<Column<N>>`][`ColumnsExt<N>`]find().(&parent).is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().())
355 })
356 .countrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/adapters/filter/impl#[`Filter<I, P>`][Iterator]count().()
357 .saturating_subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[usize]saturating_sub().(empty_columns);
358 width rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().unallocated_parents.saturating_subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[usize]saturating_sub().(1);
359 }
360 width as u64
361 }
362
363 fn reserverust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`GraphRowRenderer<N>`][`Renderer<N>`]reserve().(&mut self, node: N) {
364 if self.columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns..findrust-analyzer cargo esl01-renderdag 0.3.0 column/impl#[`Vec<Column<N>>`][`ColumnsExt<N>`]find().(&node).is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().() {
365 if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(index) = self.columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns..first_emptyrust-analyzer cargo esl01-renderdag 0.3.0 column/impl#[`Vec<Column<N>>`][`ColumnsExt<N>`]first_empty().() {
366 self.columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns.[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut().index]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut(). = Columnrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#::Reservedrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#Reserved#(node);
367 } else {
368 self.columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns..pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(Columnrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#::Reservedrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#Reserved#(node));
369 }
370 }
371 }
372
373 fn next_rowrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`GraphRowRenderer<N>`][`Renderer<N>`]next_row().(
374 &mut self,
375 node: N,
376 parents: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#<N>>,
377 glyph: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#,
378 message: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#,
379 ) -> GraphRowrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#<N> {
380 // Find a column for this node.
381 let column = self.columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns..findrust-analyzer cargo esl01-renderdag 0.3.0 column/impl#[`Vec<Column<N>>`][`ColumnsExt<N>`]find().(&node).unwrap_or_elserust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap_or_else().(|| {
382 self.columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns.
383 .first_emptyrust-analyzer cargo esl01-renderdag 0.3.0 column/impl#[`Vec<Column<N>>`][`ColumnsExt<N>`]first_empty().()
384 .unwrap_or_elserust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap_or_else().(|| self.columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns..new_emptyrust-analyzer cargo esl01-renderdag 0.3.0 column/impl#[`Vec<Column<N>>`][`ColumnsExt<N>`]new_empty().())
385 });
386 self.columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns.[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut().column]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut(). = Columnrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#::Emptyrust-analyzer cargo esl01-renderdag 0.3.0 column/Column#Empty#;
387
388 // This row is for a merge if there are multiple parents.
389 let merge = parents.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().1;
390
391 // Build the initial node line.
392 let mut node_line: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_> = self.columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns..iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|c| c.to_node_linerust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`Column<N>`]to_node_line().()).collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().();
393 node_line[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut().column]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut(). = NodeLinerust-analyzer cargo esl01-renderdag 0.3.0 render/NodeLine#::Noderust-analyzer cargo esl01-renderdag 0.3.0 render/NodeLine#Node#;
394
395 // Build the initial link line.
396 let mut link_line: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_> = self.columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns..iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|c| c.to_link_linerust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`Column<N>`]to_link_line().()).collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().();
397 let mut need_link_line = false;
398
399 // Build the initial term line.
400 let mut term_line: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_> = self.columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns..iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|_| false).collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().();
401 let mut need_term_line = false;
402
403 // Build the initial pad line.
404 let mut pad_lines: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_> = self.columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns..iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|c| c.to_pad_linerust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`Column<N>`]to_pad_line().()).collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().();
405
406 // Assign each parent to a column.
407 let mut parent_columns = BTreeMaprust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/btree/map/BTreeMap#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/btree/map/impl#[`BTreeMap<K, V>`]new().();
408 for p in parents.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().() {
409 // Check if the parent already has a column.
410 if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(parent_id) = p.idrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`Ancestor<N>`]id().() {
411 if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(index) = self.columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns..findrust-analyzer cargo esl01-renderdag 0.3.0 column/impl#[`Vec<Column<N>>`][`ColumnsExt<N>`]find().(parent_id) {
412 self.columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns.[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut().index]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut()..mergerust-analyzer cargo esl01-renderdag 0.3.0 column/impl#[`Column<N>`]merge().(&p.to_columnrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`Ancestor<N>`]to_column().());
413 parent_columns.insertrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/btree/map/impl#[`BTreeMap<K, V, A>`]insert().(index, p);
414 continue;
415 }
416 }
417 // Assign the parent to an empty column, preferring the column
418 // the current node is going in, to maintain linearity.
419 if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(index) = self.columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns..find_emptyrust-analyzer cargo esl01-renderdag 0.3.0 column/impl#[`Vec<Column<N>>`][`ColumnsExt<N>`]find_empty().(column) {
420 self.columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns.[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut().index]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut()..mergerust-analyzer cargo esl01-renderdag 0.3.0 column/impl#[`Column<N>`]merge().(&p.to_columnrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`Ancestor<N>`]to_column().());
421 parent_columns.insertrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/btree/map/impl#[`BTreeMap<K, V, A>`]insert().(index, p);
422 continue;
423 }
424 // There are no empty columns left. Make a new column.
425 parent_columns.insertrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/btree/map/impl#[`BTreeMap<K, V, A>`]insert().(self.columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns..lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().(), p);
426 node_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(NodeLinerust-analyzer cargo esl01-renderdag 0.3.0 render/NodeLine#::Blankrust-analyzer cargo esl01-renderdag 0.3.0 render/NodeLine#Blank#);
427 pad_lines.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(PadLinerust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#::Blankrust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#Blank#);
428 link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::defaultrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][Default]default().());
429 term_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(false);
430 self.columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns..pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(p.to_columnrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`Ancestor<N>`]to_column().());
431 }
432
433 // Mark parent columns with anonymous parents as terminating.
434 for (i, p) in parent_columns.iterrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/btree/map/impl#[`BTreeMap<K, V, A>`]iter().() {
435 if p.idrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`Ancestor<N>`]id().().is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().() {
436 term_line[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().i]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut(). = true;
437 need_term_line = true;
438 }
439 }
440
441 // Check if we can move the parent to the current column.
442 if parents.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().1 {
443 if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#((&parent_column, _)) = parent_columns.iterrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/btree/map/impl#[`BTreeMap<K, V, A>`]iter().().nextrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/btree/map/impl#[`Iter<'a, K, V>`][Iterator]next().() {
444 if parent_column rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().column {
445 // This node has a single parent which was already
446 // assigned to a column to the right of this one.
447 // Move the parent to this column.
448 self.columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns..swaprust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]swap().(column, parent_column);
449 let parent = parent_columns
450 .removerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/btree/map/impl#[`BTreeMap<K, V, A>`]remove().(&parent_column)
451 .expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]expect().("parent should exist");
452 parent_columns.insertrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/btree/map/impl#[`BTreeMap<K, V, A>`]insert().(column, parent);
453
454 // Generate a line from this column to the old
455 // parent column. We need to continue with the style
456 // that was being used for the parent column.
457 let was_direct = link_line[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().parent_column]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index()..containsrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]contains().(LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::VERT_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]VERT_PARENT.);
458 link_line[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut().column]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut(). rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign().if was_direct {
459 LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::RIGHT_FORK_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]RIGHT_FORK_PARENT.
460 } else {
461 LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::RIGHT_FORK_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]RIGHT_FORK_ANCESTOR.
462 };
463 #[allow(clippy::needless_range_loop)]
464 for i in column rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().1..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#parent_column {
465 link_line[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut().i]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut(). rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign().if was_direct {
466 LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::HORIZ_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]HORIZ_PARENT.
467 } else {
468 LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::HORIZ_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]HORIZ_ANCESTOR.
469 };
470 }
471 link_line[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut().parent_column]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut(). = if was_direct {
472 LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::LEFT_MERGE_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]LEFT_MERGE_PARENT.
473 } else {
474 LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::LEFT_MERGE_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]LEFT_MERGE_ANCESTOR.
475 };
476 need_link_line = true;
477 // The pad line for the old parent column is now blank.
478 pad_lines[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut().parent_column]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut(). = PadLinerust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#::Blankrust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#Blank#;
479 }
480 }
481 }
482
483 // Connect the node column to all the parent columns.
484 if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(bounds) = AncestorColumnBoundsrust-analyzer cargo esl01-renderdag 0.3.0 render/AncestorColumnBounds#::newrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[AncestorColumnBounds]new().(&parent_columns, column) {
485 // If the parents extend beyond the columns adjacent to the node, draw a horizontal
486 // ancestor line between the two outermost ancestors.
487 for i in bounds.rangerust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[AncestorColumnBounds]range().() {
488 link_line[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut().i]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut(). rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign().bounds.horizontal_linerust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[AncestorColumnBounds]horizontal_line().(i);
489 need_link_line = true;
490 }
491
492 // If there is a parent or ancestor to the right of the node
493 // column, the node merges from the right.
494 if bounds.max_parentrust-analyzer cargo esl01-renderdag 0.3.0 render/AncestorColumnBounds#max_parent. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().column {
495 link_line[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut().column]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut(). rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign().LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::RIGHT_MERGE_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]RIGHT_MERGE_PARENT.;
496 need_link_line = true;
497 } else if bounds.max_ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/AncestorColumnBounds#max_ancestor. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().column {
498 link_line[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut().column]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut(). rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign().LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::RIGHT_MERGE_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]RIGHT_MERGE_ANCESTOR.;
499 need_link_line = true;
500 }
501
502 // If there is a parent or ancestor to the left of the node column, the node merges from the left.
503 if bounds.min_parentrust-analyzer cargo esl01-renderdag 0.3.0 render/AncestorColumnBounds#min_parent. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().column {
504 link_line[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut().column]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut(). rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign().LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::LEFT_MERGE_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]LEFT_MERGE_PARENT.;
505 need_link_line = true;
506 } else if bounds.min_ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/AncestorColumnBounds#min_ancestor. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().column {
507 link_line[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut().column]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut(). rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign().LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::LEFT_MERGE_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]LEFT_MERGE_ANCESTOR.;
508 need_link_line = true;
509 }
510
511 // Each parent or ancestor forks towards the node column.
512 #[allow(clippy::comparison_chain)]
513 for (&i, p) in parent_columns.iterrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/btree/map/impl#[`BTreeMap<K, V, A>`]iter().() {
514 pad_lines[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut().i]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut(). = self.columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns.[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().i]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index()..to_pad_linerust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`Column<N>`]to_pad_line().();
515 if i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().column {
516 link_line[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut().i]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut(). rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign().
517 p.to_link_linerust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`Ancestor<N>`]to_link_line().(LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::RIGHT_FORK_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]RIGHT_FORK_PARENT., LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::RIGHT_FORK_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]RIGHT_FORK_ANCESTOR.);
518 } else if i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().column {
519 link_line[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut().i]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut(). rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign(). rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign().LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::CHILDrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]CHILD.
520 |rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOr<Self>`]bitor(). rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOr<Self>`]bitor().p.to_link_linerust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`Ancestor<N>`]to_link_line().(LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::VERT_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]VERT_PARENT., LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::VERT_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]VERT_ANCESTOR.);
521 } else {
522 link_line[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut().i]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut(). rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign().|=rust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine][`BitOrAssign<Self>`]bitor_assign().
523 p.to_link_linerust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`Ancestor<N>`]to_link_line().(LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::LEFT_FORK_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]LEFT_FORK_PARENT., LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::LEFT_FORK_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]LEFT_FORK_ANCESTOR.);
524 }
525 }
526 }
527
528 // Now that we have assigned all the columns, reset their state.
529 self.columnsrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#columns..resetrust-analyzer cargo esl01-renderdag 0.3.0 column/impl#[`Vec<Column<N>>`][`ColumnsExt<N>`]reset().();
530
531 // Filter out the link line or term line if they are not needed.
532 let link_line = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(link_line).filterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]filter().(|_| need_link_line);
533 let term_line = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(term_line).filterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]filter().(|_| need_term_line);
534
535 GraphRowrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow# {
536 noderust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#node.,
537 glyphrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#glyph.,
538 messagerust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#message.,
539 mergerust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#merge.,
540 node_linerust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#node_line.,
541 link_linerust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#link_line.,
542 term_linerust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#term_line.,
543 pad_linesrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#pad_lines.,
544 }
545 }
546 }