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§

source

fn run_if<RunB, Run: IntoWorkloadRunIf<RunB>>(self, run_if: Run) -> Workload

Only run the workload if the function evaluates to true.

source

fn skip_if<RunB, Run: IntoWorkloadRunIf<RunB>>(self, run_if: Run) -> Workload

Do not run the workload if the function evaluates to true.

source

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.

source

fn after_all<T>(self, other: impl AsLabel<T>) -> Workload

When building a workload, all systems within this workload will be placed after all invocation of the other system or workload.

source

fn rename<T>(self, name: impl AsLabel<T>) -> Workload

Changes the name of this workload.

source

fn tag<T>(self, tag: impl AsLabel<T>) -> Workload

Adds a tag to this workload. Tags can be used to control system ordering when running workloads.

Provided Methods§

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl WorkloadModificator for Workload

source§

impl<W> WorkloadModificator for W
where W: 'static + Send + Sync + Fn() -> Workload,