Trait shipyard::WorkloadModificator
source · [−]pub trait WorkloadModificator {
fn run_if<RunB, Run: IntoWorkloadRunIf<RunB>>(self, run_if: Run) -> Workload;
fn skip_if<RunB, Run: IntoWorkloadRunIf<RunB>>(self, run_if: Run) -> Workload;
fn before_all<T>(self, other: impl AsLabel<T>) -> Workload;
fn after_all<T>(self, other: impl AsLabel<T>) -> Workload;
fn rename<T>(self, name: impl AsLabel<T>) -> Workload;
fn tag<T>(self, tag: impl AsLabel<T>) -> Workload;
fn run_if_storage_empty<T: Component>(self) -> Workload
where
Self: Sized,
{ ... }
fn run_if_missing_unique<T: Unique>(self) -> Workload
where
Self: Sized,
{ ... }
fn run_if_storage_empty_by_id(self, storage_id: StorageId) -> Workload
where
Self: Sized,
{ ... }
fn skip_if_storage_empty<T: Component>(self) -> Workload
where
Self: Sized,
{ ... }
fn skip_if_missing_unique<T: Unique>(self) -> Workload
where
Self: Sized,
{ ... }
fn skip_if_storage_empty_by_id(self, storage_id: StorageId) -> Workload
where
Self: Sized,
{ ... }
}
Expand description
Modifies a workload.
Required Methods
Only run the workload if the function evaluates to true
.
Do not run the workload if the function evaluates to true
.
fn before_all<T>(self, other: impl AsLabel<T>) -> Workload
fn before_all<T>(self, other: impl AsLabel<T>) -> Workload
When building a workload, all systems within this workload will be placed before all invocation of the other system or workload.
When building a workload, all systems within this workload will be placed after all invocation of the other system or workload.
Provided Methods
fn run_if_storage_empty<T: Component>(self) -> Workload where
Self: Sized,
fn run_if_storage_empty<T: Component>(self) -> Workload where
Self: Sized,
Only run the workload 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) -> Workload where
Self: Sized,
fn run_if_missing_unique<T: Unique>(self) -> Workload where
Self: Sized,
Only run the workload if the T
unique storage is not present in the World
.
fn run_if_storage_empty_by_id(self, storage_id: StorageId) -> Workload where
Self: Sized,
fn run_if_storage_empty_by_id(self, storage_id: StorageId) -> Workload where
Self: Sized,
Only run the workload 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) -> Workload where
Self: Sized,
fn skip_if_storage_empty<T: Component>(self) -> Workload where
Self: Sized,
Do not run the workload 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) -> Workload where
Self: Sized,
fn skip_if_missing_unique<T: Unique>(self) -> Workload where
Self: Sized,
Do not run the workload if the T
unique storage is not present in the World
.
fn skip_if_storage_empty_by_id(self, storage_id: StorageId) -> Workload where
Self: Sized,
fn skip_if_storage_empty_by_id(self, storage_id: StorageId) -> Workload where
Self: Sized,
Do not run the workload 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.