@@ -340,50 +340,51 @@ mod sealed {
340
340
}
341
341
342
342
/// 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 ,
345
346
}
346
347
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 >
349
350
where
350
351
Self : Sized ,
351
352
{
352
- /// Convert into a [`SystemCollection `].
353
+ /// Convert into a [`SystemConfigs `].
353
354
#[ doc( hidden) ]
354
- fn into_collection ( self ) -> SystemCollection ;
355
+ fn into_configs ( self ) -> SystemConfigs ;
355
356
356
357
/// 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)
359
360
}
360
361
361
362
/// 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)
364
365
}
365
366
366
367
/// 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)
369
370
}
370
371
371
372
/// Treat this collection as a sequence.
372
373
///
373
374
/// 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 ( )
376
377
}
377
378
}
378
379
379
- impl IntoSystemCollection < ( ) > for SystemCollection {
380
- fn into_collection ( self ) -> Self {
380
+ impl IntoSystemConfigs < ( ) > for SystemConfigs {
381
+ fn into_configs ( self ) -> Self {
381
382
self
382
383
}
383
384
384
385
fn in_set ( mut self , set : impl SystemSet ) -> Self {
385
386
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 ( ) {
387
388
config. graph_info . sets . insert ( set. dyn_clone ( ) ) ;
388
389
}
389
390
@@ -392,7 +393,7 @@ impl IntoSystemCollection<()> for SystemCollection {
392
393
393
394
fn before < M > ( mut self , set : impl IntoSystemSet < M > ) -> Self {
394
395
let set = set. into_system_set ( ) ;
395
- for config in self . inner . iter_mut ( ) {
396
+ for config in self . systems . iter_mut ( ) {
396
397
config
397
398
. graph_info
398
399
. edges
@@ -404,7 +405,7 @@ impl IntoSystemCollection<()> for SystemCollection {
404
405
405
406
fn after < M > ( mut self , set : impl IntoSystemSet < M > ) -> Self {
406
407
let set = set. into_system_set ( ) ;
407
- for config in self . inner . iter_mut ( ) {
408
+ for config in self . systems . iter_mut ( ) {
408
409
config
409
410
. graph_info
410
411
. edges
@@ -415,55 +416,57 @@ impl IntoSystemCollection<()> for SystemCollection {
415
416
}
416
417
417
418
fn chain ( mut self ) -> Self {
418
- todo ! ( )
419
+ self . chained = true ;
420
+ self
419
421
}
420
422
}
421
423
422
424
/// 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 ,
425
428
}
426
429
427
- /// Methods that can configure multiple system sets at once .
428
- pub trait IntoSystemSetCollection
430
+ /// Types that can convert into a [`SystemSetConfigs`] .
431
+ pub trait IntoSystemSetConfigs
429
432
where
430
433
Self : Sized ,
431
434
{
432
- /// Convert into a [`SystemSetCollection `].
435
+ /// Convert into a [`SystemSetConfigs `].
433
436
#[ doc( hidden) ]
434
- fn into_collection ( self ) -> SystemSetCollection ;
437
+ fn into_configs ( self ) -> SystemSetConfigs ;
435
438
436
439
/// 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)
439
442
}
440
443
441
444
/// 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)
444
447
}
445
448
446
449
/// 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)
449
452
}
450
453
451
454
/// Treat this collection as a sequence.
452
455
///
453
456
/// 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 ( )
456
459
}
457
460
}
458
461
459
- impl IntoSystemSetCollection for SystemSetCollection {
460
- fn into_collection ( self ) -> Self {
462
+ impl IntoSystemSetConfigs for SystemSetConfigs {
463
+ fn into_configs ( self ) -> Self {
461
464
self
462
465
}
463
466
464
467
fn in_set ( mut self , set : impl SystemSet ) -> Self {
465
468
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 ( ) {
467
470
config. graph_info . sets . insert ( set. dyn_clone ( ) ) ;
468
471
}
469
472
@@ -472,7 +475,7 @@ impl IntoSystemSetCollection for SystemSetCollection {
472
475
473
476
fn before < M > ( mut self , set : impl IntoSystemSet < M > ) -> Self {
474
477
let set = set. into_system_set ( ) ;
475
- for config in self . inner . iter_mut ( ) {
478
+ for config in self . sets . iter_mut ( ) {
476
479
config
477
480
. graph_info
478
481
. edges
@@ -484,7 +487,7 @@ impl IntoSystemSetCollection for SystemSetCollection {
484
487
485
488
fn after < M > ( mut self , set : impl IntoSystemSet < M > ) -> Self {
486
489
let set = set. into_system_set ( ) ;
487
- for config in self . inner . iter_mut ( ) {
490
+ for config in self . sets . iter_mut ( ) {
488
491
config
489
492
. graph_info
490
493
. edges
@@ -495,21 +498,23 @@ impl IntoSystemSetCollection for SystemSetCollection {
495
498
}
496
499
497
500
fn chain ( mut self ) -> Self {
498
- todo ! ( )
501
+ self . chained = true ;
502
+ self
499
503
}
500
504
}
501
505
502
506
macro_rules! impl_system_collection {
503
507
( $( $param: ident, $sys: ident) ,* ) => {
504
- impl <$( $param, $sys) ,* > IntoSystemCollection <( $( $param) ,* ) > for ( $( $sys) ,* )
508
+ impl <$( $param, $sys) ,* > IntoSystemConfigs <( $( $param) ,* ) > for ( $( $sys) ,* )
505
509
where
506
510
$( $sys: IntoSystemConfig <$param>) ,*
507
511
{
508
512
#[ allow( non_snake_case) ]
509
- fn into_collection ( self ) -> SystemCollection {
513
+ fn into_configs ( self ) -> SystemConfigs {
510
514
let ( $( $sys, ) * ) = self ;
511
- SystemCollection {
512
- inner: vec![ $( $sys. into_config( ) , ) * ] ,
515
+ SystemConfigs {
516
+ systems: vec![ $( $sys. into_config( ) , ) * ] ,
517
+ chained: false ,
513
518
}
514
519
}
515
520
}
@@ -518,13 +523,14 @@ macro_rules! impl_system_collection {
518
523
519
524
macro_rules! impl_system_set_collection {
520
525
( $( $set: ident) ,* ) => {
521
- impl <$( $set: IntoSystemSetConfig ) ,* > IntoSystemSetCollection for ( $( $set) ,* )
526
+ impl <$( $set: IntoSystemSetConfig ) ,* > IntoSystemSetConfigs for ( $( $set) ,* )
522
527
{
523
528
#[ allow( non_snake_case) ]
524
- fn into_collection ( self ) -> SystemSetCollection {
529
+ fn into_configs ( self ) -> SystemSetConfigs {
525
530
let ( $( $set, ) * ) = self ;
526
- SystemSetCollection {
527
- inner: vec![ $( $set. into_config( ) , ) * ] ,
531
+ SystemSetConfigs {
532
+ sets: vec![ $( $set. into_config( ) , ) * ] ,
533
+ chained: false ,
528
534
}
529
535
}
530
536
}
0 commit comments