@@ -204,8 +204,8 @@ impl<'w, 's, 'a, 'b, T: 'static + Send + Sync> Chain<'w, 's, 'a, 'b, T> {
204
204
205
205
/// Build a workflow scope to be used as an element in this chain.
206
206
///
207
- /// If you want to connect to the stream outputs, use
208
- /// [`Self::then_scope_node`] instead.
207
+ /// If you want to connect to the stream outputs or be able to loop back
208
+ /// to the input of this scope, use [`Self::then_scope_node`] instead.
209
209
#[ must_use]
210
210
pub fn then_scope < Response , Streams , Settings > (
211
211
self ,
@@ -223,14 +223,13 @@ impl<'w, 's, 'a, 'b, T: 'static + Send + Sync> Chain<'w, 's, 'a, 'b, T> {
223
223
}
224
224
225
225
/// Simplified version of [`Self::then_scope`] limited to a simple input and
226
- /// output. This does not support streams and only uses default scope
227
- /// settings.
226
+ /// output.
228
227
///
229
228
/// Unlike `then_scope`, this function can infer the types for the generics
230
229
/// so you don't need to explicitly specify them.
231
230
pub fn then_io_scope < Response , Settings > (
232
231
self ,
233
- build : impl FnOnce ( Scope < T , Response , ( ) > , & mut Builder ) -> Settings ,
232
+ build : impl FnOnce ( Scope < T , Response > , & mut Builder ) -> Settings ,
234
233
) -> Chain < ' w , ' s , ' a , ' b , Response >
235
234
where
236
235
Response : ' static + Send + Sync ,
@@ -258,14 +257,13 @@ impl<'w, 's, 'a, 'b, T: 'static + Send + Sync> Chain<'w, 's, 'a, 'b, T> {
258
257
}
259
258
260
259
/// Simplified version of [`Self::then_scope_node`] limited to a simple
261
- /// input and output. This does not support streams and only uses default
262
- /// scope settings.
260
+ /// input and output.
263
261
///
264
262
/// Unlike `then_scope_node`, this function can infer the types for the
265
263
/// generics so you don't need to explicitly specify them.
266
264
pub fn then_io_scope_node < Response , Settings > (
267
265
self ,
268
- build : impl FnOnce ( Scope < T , Response , ( ) > , & mut Builder ) -> Settings ,
266
+ build : impl FnOnce ( Scope < T , Response > , & mut Builder ) -> Settings ,
269
267
) -> Node < T , Response , ( ) >
270
268
where
271
269
Response : ' static + Send + Sync ,
@@ -275,12 +273,13 @@ impl<'w, 's, 'a, 'b, T: 'static + Send + Sync> Chain<'w, 's, 'a, 'b, T> {
275
273
}
276
274
277
275
/// Apply a [`Provider`] that filters the response by returning an [`Option`].
278
- /// If the filter returns [`None`] then a cancellation is triggered.
279
- /// Otherwise the chain continues with the value given inside [`Some`].
276
+ /// If the filter returns [`None`] then a [`Cancellation`](crate::Cancellation)
277
+ /// is triggered. Otherwise the chain continues with the value that was
278
+ /// inside [`Some`].
280
279
///
281
280
/// This is conceptually similar to [`Iterator::filter_map`]. You can also
282
- /// use [`Chain::disposal_filter`] to dispose the remainder of the chain
283
- /// instead of cancelling it .
281
+ /// use [`Chain::disposal_filter`] to dispose of the value instead of
282
+ /// cancelling the entire scope .
284
283
#[ must_use]
285
284
pub fn cancellation_filter < ThenResponse , F > (
286
285
self ,
@@ -313,14 +312,14 @@ impl<'w, 's, 'a, 'b, T: 'static + Send + Sync> Chain<'w, 's, 'a, 'b, T> {
313
312
314
313
/// When the response is delivered, we will make a clone of it and
315
314
/// simultaneously pass that clone along two different branches chains: one
316
- /// determined by the `build` function passed into this function and the
317
- /// other determined by the [`Chain`] that gets returned by this function .
315
+ /// determined by the `build` function passed into this operation and the
316
+ /// other determined by the [`Chain`] that gets returned.
318
317
///
319
318
/// This can only be applied when `Response` can be cloned.
320
319
///
321
320
/// See also [`Chain::fork_clone`]
322
321
#[ must_use]
323
- pub fn fork_clone_branch (
322
+ pub fn branch_clone (
324
323
self ,
325
324
build : impl FnOnce ( Chain < T > ) ,
326
325
) -> Chain < ' w , ' s , ' a , ' b , T >
@@ -601,7 +600,7 @@ where
601
600
) -> Chain < ' w , ' s , ' a , ' b , T > {
602
601
Chain :: < Option < T > > :: new (
603
602
self . target , self . builder ,
604
- ) . branch_option_zip (
603
+ ) . fork_option (
605
604
|chain| chain. output ( ) ,
606
605
build_none,
607
606
) . 0 . chain ( self . builder )
@@ -614,8 +613,7 @@ where
614
613
///
615
614
/// The outputs of both builder functions will be zipped as the return value
616
615
/// of this function.
617
- #[ must_use]
618
- pub fn branch_option_zip < U , V > (
616
+ pub fn fork_option < U , V > (
619
617
self ,
620
618
build_some : impl FnOnce ( Chain < T > ) -> U ,
621
619
build_none : impl FnOnce ( Chain < ( ) > ) -> V ,
0 commit comments