Skip to content

Commit 0bf5705

Browse files
committed
Added pointers to doc on return value
1 parent 1b32d73 commit 0bf5705

File tree

1 file changed

+31
-7
lines changed

1 file changed

+31
-7
lines changed

algo/src/visits/mod.rs

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
//! [`Interrupted`] when interrupted or [`Infallible`](std::convert::Infallible)
1616
//! if the visit cannot be interrupted.
1717
//!
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
2121
//! [`no-break`](https://crates.io/crates/no-break) crate and its
2222
//! [`continue_value_no_break`](no_break::NoBreak::continue_value_no_break)
2323
//! method on the result to let type inference run smoothly.
@@ -27,8 +27,8 @@
2727
//!
2828
//! [Sequential visits](Sequential) are visits that are executed in a single
2929
//! 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).
3232
//!
3333
//! In case of interruption sequential visits usually return immediately to the
3434
//! caller, whereas in general parallel visits might need to complete part of
@@ -42,8 +42,8 @@
4242
//! available) due to race conditions.
4343
//!
4444
//! 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.
4747
//!
4848
//! There is a blanket implementation of the [`Parallel`] trait for all types
4949
//! implementing the [`Sequential`] trait. This approach makes it possible to
@@ -111,6 +111,9 @@ pub trait Sequential<A: Event> {
111111
/// Visits the graph from the specified nodes with an initialization value
112112
/// and a filter function.
113113
///
114+
/// See the [module documentation](crate::visits) for more information on
115+
/// the return value.
116+
///
114117
/// # Arguments
115118
///
116119
/// * `roots`: The nodes to start the visit from.
@@ -136,6 +139,9 @@ pub trait Sequential<A: Event> {
136139

137140
/// Visits the graph from the specified nodes with a filter function.
138141
///
142+
/// See the [module documentation](crate::visits) for more information on
143+
/// the return value.
144+
///
139145
/// # Arguments
140146
///
141147
/// * `roots`: The nodes to start the visit from.
@@ -159,6 +165,9 @@ pub trait Sequential<A: Event> {
159165

160166
/// Visits the graph from the specified nodes with an initialization value.
161167
///
168+
/// See the [module documentation](crate::visits) for more information on
169+
/// the return value.
170+
///
162171
/// # Arguments
163172
///
164173
/// * `roots`: The nodes to start the visit from.
@@ -182,6 +191,9 @@ pub trait Sequential<A: Event> {
182191

183192
/// Visits the graph from the specified nodes.
184193
///
194+
/// See the [module documentation](crate::visits) for more information on
195+
/// the return value.
196+
///
185197
/// # Arguments
186198
///
187199
/// * `roots`: The nodes to start the visit from.
@@ -213,6 +225,9 @@ pub trait Parallel<A: Event> {
213225
/// Visits the graph from the specified nodes with an initialization value
214226
/// and a filter function.
215227
///
228+
/// See the [module documentation](crate::visits) for more information on
229+
/// the return value.
230+
///
216231
/// # Arguments
217232
///
218233
/// * `roots`: The nodes to start the visit from.
@@ -242,6 +257,9 @@ pub trait Parallel<A: Event> {
242257

243258
/// Visits the graph from the specified nodes with a filter function.
244259
///
260+
/// See the [module documentation](crate::visits) for more information on
261+
/// the return value.
262+
///
245263
/// # Arguments
246264
///
247265
/// * `roots`: The nodes to start the visit from.
@@ -274,6 +292,9 @@ pub trait Parallel<A: Event> {
274292

275293
/// Visits the graph from the specified nodes with an initialization value.
276294
///
295+
/// See the [module documentation](crate::visits) for more information on
296+
/// the return value.
297+
///
277298
/// # Arguments
278299
///
279300
/// * `roots`: The nodes to start the visit from.
@@ -301,6 +322,9 @@ pub trait Parallel<A: Event> {
301322

302323
/// Visits the graph from the specified nodes.
303324
///
325+
/// See the [module documentation](crate::visits) for more information on
326+
/// the return value.
327+
///
304328
/// # Arguments
305329
///
306330
/// * `roots`: The nodes to start the visit from.

0 commit comments

Comments
 (0)