15
15
//! [`Interrupted`] when interrupted or [`Infallible`](std::convert::Infallible)
16
16
//! if the visit cannot be interrupted.
17
17
//!
18
- //! If a callback returns [`Break`](ControlFlow::Break), the visit will be
19
- //! interrupted, and the interrupt propagated to the caller of the visit method;
20
- //! for uninterruptible visits we suggest to use the
18
+ //! If a callback returns a [`Break`](ControlFlow::Break), the visit will be
19
+ //! interrupted, and the [`Break`](ControlFlow::Break) value will be the return
20
+ //! value of the visit method; for uninterruptible visits we suggest to use the
21
21
//! [`no-break`](https://crates.io/crates/no-break) crate and its
22
22
//! [`continue_value_no_break`](no_break::NoBreak::continue_value_no_break)
23
23
//! method on the result to let type inference run smoothly.
27
27
//!
28
28
//! [Sequential visits](Sequential) are visits that are executed in a single
29
29
//! thread, whereas [parallel visits](Parallel) use multiple threads. The
30
- //! signature of callbacks reflects this difference ([`FnMut`] for the sequential
31
- //! case vs. [`Fn`] + [`Sync`] for the parallel case).
30
+ //! signature of callbacks reflects this difference ([`FnMut`] for the
31
+ //! sequential case vs. [`Fn`] + [`Sync`] for the parallel case).
32
32
//!
33
33
//! In case of interruption sequential visits usually return immediately to the
34
34
//! caller, whereas in general parallel visits might need to complete part of
42
42
//! available) due to race conditions.
43
43
//!
44
44
//! All visits have also methods accepting an `init` item similarly to the
45
- //! [Rayon](rayon) [`map_with`](rayon::iter::ParallelIterator::map_with) method. For
46
- //! parallel visits, the item will be cloned.
45
+ //! [Rayon](rayon) [`map_with`](rayon::iter::ParallelIterator::map_with) method.
46
+ //! For parallel visits, the item will be cloned.
47
47
//!
48
48
//! There is a blanket implementation of the [`Parallel`] trait for all types
49
49
//! implementing the [`Sequential`] trait. This approach makes it possible to
@@ -111,6 +111,9 @@ pub trait Sequential<A: Event> {
111
111
/// Visits the graph from the specified nodes with an initialization value
112
112
/// and a filter function.
113
113
///
114
+ /// See the [module documentation](crate::visits) for more information on
115
+ /// the return value.
116
+ ///
114
117
/// # Arguments
115
118
///
116
119
/// * `roots`: The nodes to start the visit from.
@@ -136,6 +139,9 @@ pub trait Sequential<A: Event> {
136
139
137
140
/// Visits the graph from the specified nodes with a filter function.
138
141
///
142
+ /// See the [module documentation](crate::visits) for more information on
143
+ /// the return value.
144
+ ///
139
145
/// # Arguments
140
146
///
141
147
/// * `roots`: The nodes to start the visit from.
@@ -159,6 +165,9 @@ pub trait Sequential<A: Event> {
159
165
160
166
/// Visits the graph from the specified nodes with an initialization value.
161
167
///
168
+ /// See the [module documentation](crate::visits) for more information on
169
+ /// the return value.
170
+ ///
162
171
/// # Arguments
163
172
///
164
173
/// * `roots`: The nodes to start the visit from.
@@ -182,6 +191,9 @@ pub trait Sequential<A: Event> {
182
191
183
192
/// Visits the graph from the specified nodes.
184
193
///
194
+ /// See the [module documentation](crate::visits) for more information on
195
+ /// the return value.
196
+ ///
185
197
/// # Arguments
186
198
///
187
199
/// * `roots`: The nodes to start the visit from.
@@ -213,6 +225,9 @@ pub trait Parallel<A: Event> {
213
225
/// Visits the graph from the specified nodes with an initialization value
214
226
/// and a filter function.
215
227
///
228
+ /// See the [module documentation](crate::visits) for more information on
229
+ /// the return value.
230
+ ///
216
231
/// # Arguments
217
232
///
218
233
/// * `roots`: The nodes to start the visit from.
@@ -242,6 +257,9 @@ pub trait Parallel<A: Event> {
242
257
243
258
/// Visits the graph from the specified nodes with a filter function.
244
259
///
260
+ /// See the [module documentation](crate::visits) for more information on
261
+ /// the return value.
262
+ ///
245
263
/// # Arguments
246
264
///
247
265
/// * `roots`: The nodes to start the visit from.
@@ -274,6 +292,9 @@ pub trait Parallel<A: Event> {
274
292
275
293
/// Visits the graph from the specified nodes with an initialization value.
276
294
///
295
+ /// See the [module documentation](crate::visits) for more information on
296
+ /// the return value.
297
+ ///
277
298
/// # Arguments
278
299
///
279
300
/// * `roots`: The nodes to start the visit from.
@@ -301,6 +322,9 @@ pub trait Parallel<A: Event> {
301
322
302
323
/// Visits the graph from the specified nodes.
303
324
///
325
+ /// See the [module documentation](crate::visits) for more information on
326
+ /// the return value.
327
+ ///
304
328
/// # Arguments
305
329
///
306
330
/// * `roots`: The nodes to start the visit from.
0 commit comments