Trait shipyard::SystemModificator
source · [−]pub trait SystemModificator<B, R> {
Show 15 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;
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
fn 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
.
fn 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
.
fn 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.
fn 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.
fn 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.
fn 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.
fn 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.
fn 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.
fn 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
fn run_if_storage_empty<T: Component>(self) -> WorkloadSystem where
Self: Sized,
fn run_if_storage_empty<T: Component>(self) -> WorkloadSystem where
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.
fn run_if_missing_unique<T: Unique>(self) -> WorkloadSystem where
Self: Sized,
fn run_if_missing_unique<T: Unique>(self) -> WorkloadSystem where
Self: Sized,
Only run the system if the T
unique storage is not present in the World
.
fn run_if_storage_empty_by_id(self, storage_id: StorageId) -> WorkloadSystem where
Self: Sized,
fn run_if_storage_empty_by_id(self, storage_id: StorageId) -> WorkloadSystem where
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.
fn skip_if_storage_empty<T: Component>(self) -> WorkloadSystem where
Self: Sized,
fn skip_if_storage_empty<T: Component>(self) -> WorkloadSystem where
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.
fn skip_if_missing_unique<T: Unique>(self) -> WorkloadSystem where
Self: Sized,
fn skip_if_missing_unique<T: Unique>(self) -> WorkloadSystem where
Self: Sized,
Do not run the system if the T
unique storage is not present in the World
.
fn skip_if_storage_empty_by_id(self, storage_id: StorageId) -> WorkloadSystem where
Self: Sized,
fn skip_if_storage_empty_by_id(self, storage_id: StorageId) -> WorkloadSystem where
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.