@@ -340,50 +340,51 @@ mod sealed {
340340}
341341
342342/// A collection of [`SystemConfig`].
343- pub struct SystemCollection {
344- inner : Vec < SystemConfig > ,
343+ pub struct SystemConfigs {
344+ pub ( super ) systems : Vec < SystemConfig > ,
345+ pub ( super ) chained : bool ,
345346}
346347
347- /// Methods that can configure multiple systems at once .
348- pub trait IntoSystemCollection < Params >
348+ /// Types that can convert into a [`SystemConfigs`] .
349+ pub trait IntoSystemConfigs < Params >
349350where
350351 Self : Sized ,
351352{
352- /// Convert into a [`SystemCollection `].
353+ /// Convert into a [`SystemConfigs `].
353354 #[ doc( hidden) ]
354- fn into_collection ( self ) -> SystemCollection ;
355+ fn into_configs ( self ) -> SystemConfigs ;
355356
356357 /// Add to `set` membership.
357- fn in_set ( self , set : impl SystemSet ) -> SystemCollection {
358- self . into_collection ( ) . in_set ( set)
358+ fn in_set ( self , set : impl SystemSet ) -> SystemConfigs {
359+ self . into_configs ( ) . in_set ( set)
359360 }
360361
361362 /// Run before all members of `set`.
362- fn before < M > ( self , set : impl IntoSystemSet < M > ) -> SystemCollection {
363- self . into_collection ( ) . before ( set)
363+ fn before < M > ( self , set : impl IntoSystemSet < M > ) -> SystemConfigs {
364+ self . into_configs ( ) . before ( set)
364365 }
365366
366367 /// Run after all members of `set`.
367- fn after < M > ( self , set : impl IntoSystemSet < M > ) -> SystemCollection {
368- self . into_collection ( ) . after ( set)
368+ fn after < M > ( self , set : impl IntoSystemSet < M > ) -> SystemConfigs {
369+ self . into_configs ( ) . after ( set)
369370 }
370371
371372 /// Treat this collection as a sequence.
372373 ///
373374 /// Ordering constraints will be applied between the successive collection elements.
374- fn chain ( self ) -> SystemCollection {
375- self . into_collection ( ) . chain ( )
375+ fn chain ( self ) -> SystemConfigs {
376+ self . into_configs ( ) . chain ( )
376377 }
377378}
378379
379- impl IntoSystemCollection < ( ) > for SystemCollection {
380- fn into_collection ( self ) -> Self {
380+ impl IntoSystemConfigs < ( ) > for SystemConfigs {
381+ fn into_configs ( self ) -> Self {
381382 self
382383 }
383384
384385 fn in_set ( mut self , set : impl SystemSet ) -> Self {
385386 assert ! ( !set. is_system_type( ) , "invalid use of system type set" ) ;
386- for config in self . inner . iter_mut ( ) {
387+ for config in self . systems . iter_mut ( ) {
387388 config. graph_info . sets . insert ( set. dyn_clone ( ) ) ;
388389 }
389390
@@ -392,7 +393,7 @@ impl IntoSystemCollection<()> for SystemCollection {
392393
393394 fn before < M > ( mut self , set : impl IntoSystemSet < M > ) -> Self {
394395 let set = set. into_system_set ( ) ;
395- for config in self . inner . iter_mut ( ) {
396+ for config in self . systems . iter_mut ( ) {
396397 config
397398 . graph_info
398399 . edges
@@ -404,7 +405,7 @@ impl IntoSystemCollection<()> for SystemCollection {
404405
405406 fn after < M > ( mut self , set : impl IntoSystemSet < M > ) -> Self {
406407 let set = set. into_system_set ( ) ;
407- for config in self . inner . iter_mut ( ) {
408+ for config in self . systems . iter_mut ( ) {
408409 config
409410 . graph_info
410411 . edges
@@ -415,55 +416,57 @@ impl IntoSystemCollection<()> for SystemCollection {
415416 }
416417
417418 fn chain ( mut self ) -> Self {
418- todo ! ( )
419+ self . chained = true ;
420+ self
419421 }
420422}
421423
422424/// A collection of [`SystemSetConfig`].
423- pub struct SystemSetCollection {
424- inner : Vec < SystemSetConfig > ,
425+ pub struct SystemSetConfigs {
426+ pub ( super ) sets : Vec < SystemSetConfig > ,
427+ pub ( super ) chained : bool ,
425428}
426429
427430/// Methods that can configure multiple system sets at once.
428- pub trait IntoSystemSetCollection
431+ pub trait IntoSystemSetConfigs
429432where
430433 Self : Sized ,
431434{
432- /// Convert into a [`SystemSetCollection `].
435+ /// Convert into a [`SystemSetConfigs `].
433436 #[ doc( hidden) ]
434- fn into_collection ( self ) -> SystemSetCollection ;
437+ fn into_configs ( self ) -> SystemSetConfigs ;
435438
436439 /// Add to `set` membership.
437- fn in_set ( self , set : impl SystemSet ) -> SystemSetCollection {
438- self . into_collection ( ) . in_set ( set)
440+ fn in_set ( self , set : impl SystemSet ) -> SystemSetConfigs {
441+ self . into_configs ( ) . in_set ( set)
439442 }
440443
441444 /// Run before all members of `set`.
442- fn before < M > ( self , set : impl IntoSystemSet < M > ) -> SystemSetCollection {
443- self . into_collection ( ) . before ( set)
445+ fn before < M > ( self , set : impl IntoSystemSet < M > ) -> SystemSetConfigs {
446+ self . into_configs ( ) . before ( set)
444447 }
445448
446449 /// Run after all members of `set`.
447- fn after < M > ( self , set : impl IntoSystemSet < M > ) -> SystemSetCollection {
448- self . into_collection ( ) . after ( set)
450+ fn after < M > ( self , set : impl IntoSystemSet < M > ) -> SystemSetConfigs {
451+ self . into_configs ( ) . after ( set)
449452 }
450453
451454 /// Treat this collection as a sequence.
452455 ///
453456 /// Ordering constraints will be applied between the successive collection elements.
454- fn chain ( self ) -> SystemSetCollection {
455- self . into_collection ( ) . chain ( )
457+ fn chain ( self ) -> SystemSetConfigs {
458+ self . into_configs ( ) . chain ( )
456459 }
457460}
458461
459- impl IntoSystemSetCollection for SystemSetCollection {
460- fn into_collection ( self ) -> Self {
462+ impl IntoSystemSetConfigs for SystemSetConfigs {
463+ fn into_configs ( self ) -> Self {
461464 self
462465 }
463466
464467 fn in_set ( mut self , set : impl SystemSet ) -> Self {
465468 assert ! ( !set. is_system_type( ) , "invalid use of system type set" ) ;
466- for config in self . inner . iter_mut ( ) {
469+ for config in self . sets . iter_mut ( ) {
467470 config. graph_info . sets . insert ( set. dyn_clone ( ) ) ;
468471 }
469472
@@ -472,7 +475,7 @@ impl IntoSystemSetCollection for SystemSetCollection {
472475
473476 fn before < M > ( mut self , set : impl IntoSystemSet < M > ) -> Self {
474477 let set = set. into_system_set ( ) ;
475- for config in self . inner . iter_mut ( ) {
478+ for config in self . sets . iter_mut ( ) {
476479 config
477480 . graph_info
478481 . edges
@@ -484,7 +487,7 @@ impl IntoSystemSetCollection for SystemSetCollection {
484487
485488 fn after < M > ( mut self , set : impl IntoSystemSet < M > ) -> Self {
486489 let set = set. into_system_set ( ) ;
487- for config in self . inner . iter_mut ( ) {
490+ for config in self . sets . iter_mut ( ) {
488491 config
489492 . graph_info
490493 . edges
@@ -495,21 +498,23 @@ impl IntoSystemSetCollection for SystemSetCollection {
495498 }
496499
497500 fn chain ( mut self ) -> Self {
498- todo ! ( )
501+ self . chained = true ;
502+ self
499503 }
500504}
501505
502506macro_rules! impl_system_collection {
503507 ( $( $param: ident, $sys: ident) ,* ) => {
504- impl <$( $param, $sys) ,* > IntoSystemCollection <( $( $param) ,* ) > for ( $( $sys) ,* )
508+ impl <$( $param, $sys) ,* > IntoSystemConfigs <( $( $param) ,* ) > for ( $( $sys) ,* )
505509 where
506510 $( $sys: IntoSystemConfig <$param>) ,*
507511 {
508512 #[ allow( non_snake_case) ]
509- fn into_collection ( self ) -> SystemCollection {
513+ fn into_configs ( self ) -> SystemConfigs {
510514 let ( $( $sys, ) * ) = self ;
511- SystemCollection {
512- inner: vec![ $( $sys. into_config( ) , ) * ] ,
515+ SystemConfigs {
516+ systems: vec![ $( $sys. into_config( ) , ) * ] ,
517+ chained: false ,
513518 }
514519 }
515520 }
@@ -518,13 +523,14 @@ macro_rules! impl_system_collection {
518523
519524macro_rules! impl_system_set_collection {
520525 ( $( $set: ident) ,* ) => {
521- impl <$( $set: IntoSystemSetConfig ) ,* > IntoSystemSetCollection for ( $( $set) ,* )
526+ impl <$( $set: IntoSystemSetConfig ) ,* > IntoSystemSetConfigs for ( $( $set) ,* )
522527 {
523528 #[ allow( non_snake_case) ]
524- fn into_collection ( self ) -> SystemSetCollection {
529+ fn into_configs ( self ) -> SystemSetConfigs {
525530 let ( $( $set, ) * ) = self ;
526- SystemSetCollection {
527- inner: vec![ $( $set. into_config( ) , ) * ] ,
531+ SystemSetConfigs {
532+ sets: vec![ $( $set. into_config( ) , ) * ] ,
533+ chained: false ,
528534 }
529535 }
530536 }
0 commit comments