Trait shipyard::SystemModificator
source · pub trait SystemModificator<B, R> {
Show 15 methods
// Required methods
fn run_if<RunB, Run: IntoRunIf<RunB>>(self, run_if: Run) -> WorkloadSystem;
fn skip_if<RunB, Run: IntoRunIf<RunB>>(self, run_if: Run) -> WorkloadSystem;
fn before_all<T>(self, other: impl AsLabel<T>) -> WorkloadSystem;
fn after_all<T>(self, other: impl AsLabel<T>) -> WorkloadSystem;
fn display_name<T>(self, name: impl AsLabel<T>) -> WorkloadSystem;
fn tag<T>(self, tag: impl AsLabel<T>) -> WorkloadSystem;
fn require_in_workload<T>(self, other: impl AsLabel<T>) -> WorkloadSystem;
fn require_before<T>(self, other: impl AsLabel<T>) -> WorkloadSystem;
fn require_after<T>(self, other: impl AsLabel<T>) -> WorkloadSystem;
// Provided methods
fn run_if_storage_empty<T: Component>(self) -> WorkloadSystem
where Self: Sized { ... }
fn run_if_missing_unique<T: Unique>(self) -> WorkloadSystem
where Self: Sized { ... }
fn run_if_storage_empty_by_id(self, storage_id: StorageId) -> WorkloadSystem
where Self: Sized { ... }
fn skip_if_storage_empty<T: Component>(self) -> WorkloadSystem
where Self: Sized { ... }
fn skip_if_missing_unique<T: Unique>(self) -> WorkloadSystem
where Self: Sized { ... }
fn skip_if_storage_empty_by_id(
self,
storage_id: StorageId,
) -> WorkloadSystem
where Self: Sized { ... }
}
Expand description
Modifies a system.
Required Methods§
sourcefn run_if<RunB, Run: IntoRunIf<RunB>>(self, run_if: Run) -> WorkloadSystem
fn run_if<RunB, Run: IntoRunIf<RunB>>(self, run_if: Run) -> WorkloadSystem
Only run the system if the function evaluates to true
.
sourcefn skip_if<RunB, Run: IntoRunIf<RunB>>(self, run_if: Run) -> WorkloadSystem
fn skip_if<RunB, Run: IntoRunIf<RunB>>(self, run_if: Run) -> WorkloadSystem
Do not run the system if the function evaluates to true
.
sourcefn before_all<T>(self, other: impl AsLabel<T>) -> WorkloadSystem
fn before_all<T>(self, other: impl AsLabel<T>) -> WorkloadSystem
When building a workload, this system will be placed before all invocation of the other system or workload.
sourcefn after_all<T>(self, other: impl AsLabel<T>) -> WorkloadSystem
fn after_all<T>(self, other: impl AsLabel<T>) -> WorkloadSystem
When building a workload, this system will be placed after all invocation of the other system or workload.
sourcefn display_name<T>(self, name: impl AsLabel<T>) -> WorkloadSystem
fn display_name<T>(self, name: impl AsLabel<T>) -> WorkloadSystem
System name used in error and gui built for shipyard.
Defaults to the system function name.
sourcefn tag<T>(self, tag: impl AsLabel<T>) -> WorkloadSystem
fn tag<T>(self, tag: impl AsLabel<T>) -> WorkloadSystem
Adds a tag to this system. Tags can be used to control system ordering when running workloads.
sourcefn require_in_workload<T>(self, other: impl AsLabel<T>) -> WorkloadSystem
fn require_in_workload<T>(self, other: impl AsLabel<T>) -> WorkloadSystem
When building a workload, this system will assert that at least one of the other system is present in the workload.
Does not change system ordering.
sourcefn require_before<T>(self, other: impl AsLabel<T>) -> WorkloadSystem
fn require_before<T>(self, other: impl AsLabel<T>) -> WorkloadSystem
When building a workload, this system will assert that at least one of the other system is present before itself in the workload.
Does not change system ordering.
sourcefn require_after<T>(self, other: impl AsLabel<T>) -> WorkloadSystem
fn require_after<T>(self, other: impl AsLabel<T>) -> WorkloadSystem
When building a workload, this system will assert that at least one of the other system is present after itself in the workload.
Does not change system ordering.
Provided Methods§
sourcefn run_if_storage_empty<T: Component>(self) -> WorkloadSystemwhere
Self: Sized,
fn run_if_storage_empty<T: Component>(self) -> WorkloadSystemwhere
Self: Sized,
Only run the system if the T
storage is empty.
If the storage is not present it is considered empty. If the storage is already borrowed, assume it’s not empty.
sourcefn run_if_missing_unique<T: Unique>(self) -> WorkloadSystemwhere
Self: Sized,
fn run_if_missing_unique<T: Unique>(self) -> WorkloadSystemwhere
Self: Sized,
Only run the system if the T
unique storage is not present in the World
.
sourcefn run_if_storage_empty_by_id(self, storage_id: StorageId) -> WorkloadSystemwhere
Self: Sized,
fn run_if_storage_empty_by_id(self, storage_id: StorageId) -> WorkloadSystemwhere
Self: Sized,
Only run the system if the storage is empty.
If the storage is not present it is considered empty. If the storage is already borrowed, assume it’s not empty.
sourcefn skip_if_storage_empty<T: Component>(self) -> WorkloadSystemwhere
Self: Sized,
fn skip_if_storage_empty<T: Component>(self) -> WorkloadSystemwhere
Self: Sized,
Do not run the system if the T
storage is empty.
If the storage is not present it is considered empty. If the storage is already borrowed, assume it’s not empty.
sourcefn skip_if_missing_unique<T: Unique>(self) -> WorkloadSystemwhere
Self: Sized,
fn skip_if_missing_unique<T: Unique>(self) -> WorkloadSystemwhere
Self: Sized,
Do not run the system if the T
unique storage is not present in the World
.
sourcefn skip_if_storage_empty_by_id(self, storage_id: StorageId) -> WorkloadSystemwhere
Self: Sized,
fn skip_if_storage_empty_by_id(self, storage_id: StorageId) -> WorkloadSystemwhere
Self: Sized,
Do not run the system if the storage is empty.
If the storage is not present it is considered empty. If the storage is already borrowed, assume it’s not empty.