Trait shipyard::WorkloadModificator
source · pub trait WorkloadModificator {
// Required methods
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;
// Provided methods
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§
sourcefn run_if<RunB, Run: IntoWorkloadRunIf<RunB>>(self, run_if: Run) -> Workload
fn run_if<RunB, Run: IntoWorkloadRunIf<RunB>>(self, run_if: Run) -> Workload
Only run the workload if the function evaluates to true
.
sourcefn skip_if<RunB, Run: IntoWorkloadRunIf<RunB>>(self, run_if: Run) -> Workload
fn skip_if<RunB, Run: IntoWorkloadRunIf<RunB>>(self, run_if: Run) -> Workload
Do not run the workload if the function evaluates to true
.
sourcefn 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.
Provided Methods§
sourcefn run_if_storage_empty<T: Component>(self) -> Workloadwhere
Self: Sized,
fn run_if_storage_empty<T: Component>(self) -> Workloadwhere
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.
sourcefn run_if_missing_unique<T: Unique>(self) -> Workloadwhere
Self: Sized,
fn run_if_missing_unique<T: Unique>(self) -> Workloadwhere
Self: Sized,
Only run the workload if the T
unique storage is not present in the World
.
sourcefn run_if_storage_empty_by_id(self, storage_id: StorageId) -> Workloadwhere
Self: Sized,
fn run_if_storage_empty_by_id(self, storage_id: StorageId) -> Workloadwhere
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.
sourcefn skip_if_storage_empty<T: Component>(self) -> Workloadwhere
Self: Sized,
fn skip_if_storage_empty<T: Component>(self) -> Workloadwhere
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.
sourcefn skip_if_missing_unique<T: Unique>(self) -> Workloadwhere
Self: Sized,
fn skip_if_missing_unique<T: Unique>(self) -> Workloadwhere
Self: Sized,
Do not run the workload if the T
unique storage is not present in the World
.
sourcefn skip_if_storage_empty_by_id(self, storage_id: StorageId) -> Workloadwhere
Self: Sized,
fn skip_if_storage_empty_by_id(self, storage_id: StorageId) -> Workloadwhere
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.