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§

source

fn run_if<RunB, Run: IntoRunIf<RunB>>(self, run_if: Run) -> WorkloadSystem

Only run the system if the function evaluates to true.

source

fn skip_if<RunB, Run: IntoRunIf<RunB>>(self, run_if: Run) -> WorkloadSystem

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

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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§

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl SystemModificator<WorkloadSystem, ()> for WorkloadSystem

source§

impl<A: WorldBorrow + BorrowInfo, B: WorldBorrow + BorrowInfo, C: WorldBorrow + BorrowInfo, D: WorldBorrow + BorrowInfo, E: WorldBorrow + BorrowInfo, F: WorldBorrow + BorrowInfo, G: WorldBorrow + BorrowInfo, H: WorldBorrow + BorrowInfo, I: WorldBorrow + BorrowInfo, J: WorldBorrow + BorrowInfo, R, Func> SystemModificator<(A, B, C, D, E, F, G, H, I, J), R> for Func
where R: 'static, Func: 'static + Send + Sync, for<'a, 'b> &'b Func: Fn(A, B, C, D, E, F, G, H, I, J) -> R + Fn(A::WorldView<'a>, B::WorldView<'a>, C::WorldView<'a>, D::WorldView<'a>, E::WorldView<'a>, F::WorldView<'a>, G::WorldView<'a>, H::WorldView<'a>, I::WorldView<'a>, J::WorldView<'a>) -> R,

source§

impl<A: WorldBorrow + BorrowInfo, B: WorldBorrow + BorrowInfo, C: WorldBorrow + BorrowInfo, D: WorldBorrow + BorrowInfo, E: WorldBorrow + BorrowInfo, F: WorldBorrow + BorrowInfo, G: WorldBorrow + BorrowInfo, H: WorldBorrow + BorrowInfo, I: WorldBorrow + BorrowInfo, R, Func> SystemModificator<(A, B, C, D, E, F, G, H, I), R> for Func
where R: 'static, Func: 'static + Send + Sync, for<'a, 'b> &'b Func: Fn(A, B, C, D, E, F, G, H, I) -> R + Fn(A::WorldView<'a>, B::WorldView<'a>, C::WorldView<'a>, D::WorldView<'a>, E::WorldView<'a>, F::WorldView<'a>, G::WorldView<'a>, H::WorldView<'a>, I::WorldView<'a>) -> R,

source§

impl<A: WorldBorrow + BorrowInfo, B: WorldBorrow + BorrowInfo, C: WorldBorrow + BorrowInfo, D: WorldBorrow + BorrowInfo, E: WorldBorrow + BorrowInfo, F: WorldBorrow + BorrowInfo, G: WorldBorrow + BorrowInfo, H: WorldBorrow + BorrowInfo, R, Func> SystemModificator<(A, B, C, D, E, F, G, H), R> for Func
where R: 'static, Func: 'static + Send + Sync, for<'a, 'b> &'b Func: Fn(A, B, C, D, E, F, G, H) -> R + Fn(A::WorldView<'a>, B::WorldView<'a>, C::WorldView<'a>, D::WorldView<'a>, E::WorldView<'a>, F::WorldView<'a>, G::WorldView<'a>, H::WorldView<'a>) -> R,

source§

impl<A: WorldBorrow + BorrowInfo, B: WorldBorrow + BorrowInfo, C: WorldBorrow + BorrowInfo, D: WorldBorrow + BorrowInfo, E: WorldBorrow + BorrowInfo, F: WorldBorrow + BorrowInfo, G: WorldBorrow + BorrowInfo, R, Func> SystemModificator<(A, B, C, D, E, F, G), R> for Func
where R: 'static, Func: 'static + Send + Sync, for<'a, 'b> &'b Func: Fn(A, B, C, D, E, F, G) -> R + Fn(A::WorldView<'a>, B::WorldView<'a>, C::WorldView<'a>, D::WorldView<'a>, E::WorldView<'a>, F::WorldView<'a>, G::WorldView<'a>) -> R,

source§

impl<A: WorldBorrow + BorrowInfo, B: WorldBorrow + BorrowInfo, C: WorldBorrow + BorrowInfo, D: WorldBorrow + BorrowInfo, E: WorldBorrow + BorrowInfo, F: WorldBorrow + BorrowInfo, R, Func> SystemModificator<(A, B, C, D, E, F), R> for Func
where R: 'static, Func: 'static + Send + Sync, for<'a, 'b> &'b Func: Fn(A, B, C, D, E, F) -> R + Fn(A::WorldView<'a>, B::WorldView<'a>, C::WorldView<'a>, D::WorldView<'a>, E::WorldView<'a>, F::WorldView<'a>) -> R,

source§

impl<A: WorldBorrow + BorrowInfo, B: WorldBorrow + BorrowInfo, C: WorldBorrow + BorrowInfo, D: WorldBorrow + BorrowInfo, E: WorldBorrow + BorrowInfo, R, Func> SystemModificator<(A, B, C, D, E), R> for Func
where R: 'static, Func: 'static + Send + Sync, for<'a, 'b> &'b Func: Fn(A, B, C, D, E) -> R + Fn(A::WorldView<'a>, B::WorldView<'a>, C::WorldView<'a>, D::WorldView<'a>, E::WorldView<'a>) -> R,

source§

impl<A: WorldBorrow + BorrowInfo, B: WorldBorrow + BorrowInfo, C: WorldBorrow + BorrowInfo, D: WorldBorrow + BorrowInfo, R, Func> SystemModificator<(A, B, C, D), R> for Func
where R: 'static, Func: 'static + Send + Sync, for<'a, 'b> &'b Func: Fn(A, B, C, D) -> R + Fn(A::WorldView<'a>, B::WorldView<'a>, C::WorldView<'a>, D::WorldView<'a>) -> R,

source§

impl<A: WorldBorrow + BorrowInfo, B: WorldBorrow + BorrowInfo, C: WorldBorrow + BorrowInfo, R, Func> SystemModificator<(A, B, C), R> for Func
where R: 'static, Func: 'static + Send + Sync, for<'a, 'b> &'b Func: Fn(A, B, C) -> R + Fn(A::WorldView<'a>, B::WorldView<'a>, C::WorldView<'a>) -> R,

source§

impl<A: WorldBorrow + BorrowInfo, B: WorldBorrow + BorrowInfo, R, Func> SystemModificator<(A, B), R> for Func
where R: 'static, Func: 'static + Send + Sync, for<'a, 'b> &'b Func: Fn(A, B) -> R + Fn(A::WorldView<'a>, B::WorldView<'a>) -> R,

source§

impl<A: WorldBorrow + BorrowInfo, R, Func> SystemModificator<(A,), R> for Func
where R: 'static, Func: 'static + Send + Sync, for<'a, 'b> &'b Func: Fn(A) -> R + Fn(A::WorldView<'a>) -> R,