pub struct SystemDesc<Sys> {
pub group_index: u16,
pub volatile: bool,
pub activation: (Tick, InsertPos),
/* private fields */
}Expand description
A descriptor for a System.
Fields§
§group_index: u16Group index of the system.
volatile: boolWhether the system is volatile or not. A volatile system will be discarded from memory after get executed as much as its lifetime. Unlike volatile system, non-volatile system will move to inactivate state instead of being discarded.
activation: (Tick, InsertPos)Lifetime and insert position in an active system cycle.
- Lifetime(live): Determines how long the system should be executed. Whenever client schedules ecs, lifetime of executed system decreases by 1 conceptually. Zero lifetime is considered inactivation.
- Insert position: Active systems get executed in an order. Client can
designate where the system locates.
InsertPos::Frontmeans the first position in the order, whileInsertPos::Backmeans the last position in the order. Of course, client can put the system in the middle of the order byInsertPos::After.
Implementations§
Source§impl<Sys> SystemDesc<Sys>where
Sys: System,
impl<Sys> SystemDesc<Sys>where
Sys: System,
pub fn with_system<T, OutSys>(self, sys: T) -> SystemDesc<OutSys>
pub fn with_once<T, Req, F>(self, sys: T) -> SystemDesc<FnOnceSystem<Req, F>>
pub fn with_group_index(self, index: u16) -> Self
pub fn with_volatile(self, volatile: bool) -> Self
pub fn with_activation(self, live: Tick, insert_at: InsertPos) -> Self
pub fn take_system(self) -> Sys
Trait Implementations§
Source§impl<Sys> Debug for SystemDesc<Sys>
impl<Sys> Debug for SystemDesc<Sys>
Source§impl Default for SystemDesc<()>
impl Default for SystemDesc<()>
Source§impl<F, EW> From<F> for SystemDesc<FnSystem<(Ph, Ph, Ph, Ph, EW), F>>
impl<F, EW> From<F> for SystemDesc<FnSystem<(Ph, Ph, Ph, Ph, EW), F>>
Source§impl<F> From<F> for SystemDesc<FnSystem<(Ph, Ph, Ph, Ph, Ph), F>>
impl<F> From<F> for SystemDesc<FnSystem<(Ph, Ph, Ph, Ph, Ph), F>>
Source§impl<F, RW, EW> From<F> for SystemDesc<FnSystem<(Ph, Ph, Ph, RW, EW), F>>
impl<F, RW, EW> From<F> for SystemDesc<FnSystem<(Ph, Ph, Ph, RW, EW), F>>
Source§impl<F, RW> From<F> for SystemDesc<FnSystem<(Ph, Ph, Ph, RW, Ph), F>>
impl<F, RW> From<F> for SystemDesc<FnSystem<(Ph, Ph, Ph, RW, Ph), F>>
Source§impl<F, RR, EW> From<F> for SystemDesc<FnSystem<(Ph, Ph, RR, Ph, EW), F>>
impl<F, RR, EW> From<F> for SystemDesc<FnSystem<(Ph, Ph, RR, Ph, EW), F>>
Source§impl<F, RR> From<F> for SystemDesc<FnSystem<(Ph, Ph, RR, Ph, Ph), F>>
impl<F, RR> From<F> for SystemDesc<FnSystem<(Ph, Ph, RR, Ph, Ph), F>>
Source§impl<F, RR, RW, EW> From<F> for SystemDesc<FnSystem<(Ph, Ph, RR, RW, EW), F>>
impl<F, RR, RW, EW> From<F> for SystemDesc<FnSystem<(Ph, Ph, RR, RW, EW), F>>
Source§impl<F, RR, RW> From<F> for SystemDesc<FnSystem<(Ph, Ph, RR, RW, Ph), F>>
impl<F, RR, RW> From<F> for SystemDesc<FnSystem<(Ph, Ph, RR, RW, Ph), F>>
Source§impl<F, W, EW> From<F> for SystemDesc<FnSystem<(Ph, W, Ph, Ph, EW), F>>
impl<F, W, EW> From<F> for SystemDesc<FnSystem<(Ph, W, Ph, Ph, EW), F>>
Source§impl<F, W> From<F> for SystemDesc<FnSystem<(Ph, W, Ph, Ph, Ph), F>>
impl<F, W> From<F> for SystemDesc<FnSystem<(Ph, W, Ph, Ph, Ph), F>>
Source§impl<F, W, RW, EW> From<F> for SystemDesc<FnSystem<(Ph, W, Ph, RW, EW), F>>
impl<F, W, RW, EW> From<F> for SystemDesc<FnSystem<(Ph, W, Ph, RW, EW), F>>
Source§impl<F, W, RW> From<F> for SystemDesc<FnSystem<(Ph, W, Ph, RW, Ph), F>>
impl<F, W, RW> From<F> for SystemDesc<FnSystem<(Ph, W, Ph, RW, Ph), F>>
Source§impl<F, W, RR, EW> From<F> for SystemDesc<FnSystem<(Ph, W, RR, Ph, EW), F>>
impl<F, W, RR, EW> From<F> for SystemDesc<FnSystem<(Ph, W, RR, Ph, EW), F>>
Source§impl<F, W, RR> From<F> for SystemDesc<FnSystem<(Ph, W, RR, Ph, Ph), F>>
impl<F, W, RR> From<F> for SystemDesc<FnSystem<(Ph, W, RR, Ph, Ph), F>>
Source§impl<F, W, RR, RW, EW> From<F> for SystemDesc<FnSystem<(Ph, W, RR, RW, EW), F>>
impl<F, W, RR, RW, EW> From<F> for SystemDesc<FnSystem<(Ph, W, RR, RW, EW), F>>
Source§impl<F, W, RR, RW> From<F> for SystemDesc<FnSystem<(Ph, W, RR, RW, Ph), F>>
impl<F, W, RR, RW> From<F> for SystemDesc<FnSystem<(Ph, W, RR, RW, Ph), F>>
Source§impl<F, R, EW> From<F> for SystemDesc<FnSystem<(R, Ph, Ph, Ph, EW), F>>
impl<F, R, EW> From<F> for SystemDesc<FnSystem<(R, Ph, Ph, Ph, EW), F>>
Source§impl<F, R> From<F> for SystemDesc<FnSystem<(R, Ph, Ph, Ph, Ph), F>>
impl<F, R> From<F> for SystemDesc<FnSystem<(R, Ph, Ph, Ph, Ph), F>>
Source§impl<F, R, RW, EW> From<F> for SystemDesc<FnSystem<(R, Ph, Ph, RW, EW), F>>
impl<F, R, RW, EW> From<F> for SystemDesc<FnSystem<(R, Ph, Ph, RW, EW), F>>
Source§impl<F, R, RW> From<F> for SystemDesc<FnSystem<(R, Ph, Ph, RW, Ph), F>>
impl<F, R, RW> From<F> for SystemDesc<FnSystem<(R, Ph, Ph, RW, Ph), F>>
Source§impl<F, R, RR, EW> From<F> for SystemDesc<FnSystem<(R, Ph, RR, Ph, EW), F>>
impl<F, R, RR, EW> From<F> for SystemDesc<FnSystem<(R, Ph, RR, Ph, EW), F>>
Source§impl<F, R, RR> From<F> for SystemDesc<FnSystem<(R, Ph, RR, Ph, Ph), F>>
impl<F, R, RR> From<F> for SystemDesc<FnSystem<(R, Ph, RR, Ph, Ph), F>>
Source§impl<F, R, RR, RW, EW> From<F> for SystemDesc<FnSystem<(R, Ph, RR, RW, EW), F>>
impl<F, R, RR, RW, EW> From<F> for SystemDesc<FnSystem<(R, Ph, RR, RW, EW), F>>
Source§impl<F, R, RR, RW> From<F> for SystemDesc<FnSystem<(R, Ph, RR, RW, Ph), F>>
impl<F, R, RR, RW> From<F> for SystemDesc<FnSystem<(R, Ph, RR, RW, Ph), F>>
Source§impl<F, R, W, EW> From<F> for SystemDesc<FnSystem<(R, W, Ph, Ph, EW), F>>
impl<F, R, W, EW> From<F> for SystemDesc<FnSystem<(R, W, Ph, Ph, EW), F>>
Source§impl<F, R, W> From<F> for SystemDesc<FnSystem<(R, W, Ph, Ph, Ph), F>>
impl<F, R, W> From<F> for SystemDesc<FnSystem<(R, W, Ph, Ph, Ph), F>>
Source§impl<F, R, W, RW, EW> From<F> for SystemDesc<FnSystem<(R, W, Ph, RW, EW), F>>
impl<F, R, W, RW, EW> From<F> for SystemDesc<FnSystem<(R, W, Ph, RW, EW), F>>
Source§impl<F, R, W, RW> From<F> for SystemDesc<FnSystem<(R, W, Ph, RW, Ph), F>>
impl<F, R, W, RW> From<F> for SystemDesc<FnSystem<(R, W, Ph, RW, Ph), F>>
Source§impl<F, R, W, RR, EW> From<F> for SystemDesc<FnSystem<(R, W, RR, Ph, EW), F>>
impl<F, R, W, RR, EW> From<F> for SystemDesc<FnSystem<(R, W, RR, Ph, EW), F>>
Source§impl<F, R, W, RR> From<F> for SystemDesc<FnSystem<(R, W, RR, Ph, Ph), F>>
impl<F, R, W, RR> From<F> for SystemDesc<FnSystem<(R, W, RR, Ph, Ph), F>>
Source§impl<F, R, W, RR, RW, EW> From<F> for SystemDesc<FnSystem<(R, W, RR, RW, EW), F>>
impl<F, R, W, RR, RW, EW> From<F> for SystemDesc<FnSystem<(R, W, RR, RW, EW), F>>
Source§impl<F, R, W, RR, RW> From<F> for SystemDesc<FnSystem<(R, W, RR, RW, Ph), F>>
impl<F, R, W, RR, RW> From<F> for SystemDesc<FnSystem<(R, W, RR, RW, Ph), F>>
Auto Trait Implementations§
impl<Sys> Freeze for SystemDesc<Sys>where
Sys: Freeze,
impl<Sys> !RefUnwindSafe for SystemDesc<Sys>
impl<Sys> Send for SystemDesc<Sys>where
Sys: Send,
impl<Sys> Sync for SystemDesc<Sys>where
Sys: Sync,
impl<Sys> Unpin for SystemDesc<Sys>where
Sys: Unpin,
impl<Sys> !UnwindSafe for SystemDesc<Sys>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more