Struct shipyard::WorkloadSystem
source · [−]pub struct WorkloadSystem { /* private fields */ }
Expand description
Self contained system that may be inserted into a Workload
.
Example:
use shipyard::{Component, IntoWorkloadSystem, View, Workload, WorkloadSystem, World};
#[derive(Component)]
struct U32(u32);
#[derive(Component)]
struct USIZE(usize);
fn sys1(u32s: View<U32>) {}
fn sys2(usizes: View<USIZE>) {}
let workload_sys1: WorkloadSystem = sys1.into_workload_system().unwrap();
let mut workload = Workload::new("my_workload")
.with_system(workload_sys1)
.with_system(sys2);
Trait Implementations
sourceimpl Extend<WorkloadSystem> for Workload
impl Extend<WorkloadSystem> for Workload
sourcefn extend<T: IntoIterator<Item = WorkloadSystem>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = WorkloadSystem>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl IntoWorkloadSystem<WorkloadSystem, ()> for WorkloadSystem
impl IntoWorkloadSystem<WorkloadSystem, ()> for WorkloadSystem
sourcefn into_workload_system(self) -> Result<WorkloadSystem, InvalidSystem>
fn into_workload_system(self) -> Result<WorkloadSystem, InvalidSystem>
Wraps a function in a struct containing all information required by a workload.
sourceimpl SystemModificator<WorkloadSystem, ()> for WorkloadSystem
impl SystemModificator<WorkloadSystem, ()> for WorkloadSystem
sourcefn 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
.
sourcefn 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
.
sourcefn 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.
sourcefn 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.
sourcefn 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. Read more
sourcefn 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.
sourcefn 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. Read more
sourcefn 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. Read more
sourcefn 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. Read more
sourcefn 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. Read more
sourcefn 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
.
sourcefn 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. Read more
sourcefn 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. Read more
sourcefn 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
.
sourcefn 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. Read more
Auto Trait Implementations
impl !RefUnwindSafe for WorkloadSystem
impl Send for WorkloadSystem
impl Sync for WorkloadSystem
impl Unpin for WorkloadSystem
impl !UnwindSafe for WorkloadSystem
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more