Struct SystemDesc

Source
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: u16

Group index of the system.

§volatile: bool

Whether 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::Front means the first position in the order, while InsertPos::Back means the last position in the order. Of course, client can put the system in the middle of the order by InsertPos::After.

Implementations§

Source§

impl<Sys> SystemDesc<Sys>
where Sys: System,

Source

pub fn with_system<T, OutSys>(self, sys: T) -> SystemDesc<OutSys>
where T: Into<SystemBond<OutSys>>, OutSys: System,

Source

pub fn with_once<T, Req, F>(self, sys: T) -> SystemDesc<FnOnceSystem<Req, F>>
where T: Into<FnOnceSystem<Req, F>>, FnOnceSystem<Req, F>: System,

Source

pub fn with_group_index(self, index: u16) -> Self

Source

pub fn with_volatile(self, volatile: bool) -> Self

Source

pub fn with_activation(self, live: Tick, insert_at: InsertPos) -> Self

Source

pub fn take_system(self) -> Sys

Source§

impl SystemDesc<()>

Source

pub const fn new() -> Self

Trait Implementations§

Source§

impl<Sys> Debug for SystemDesc<Sys>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SystemDesc<()>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<F, EW> From<F> for SystemDesc<FnSystem<(Ph, Ph, Ph, Ph, EW), F>>
where F: FnMut(EntWrite<'_, EW>) + Send + 'static, EW: EntQueryMut,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F> From<F> for SystemDesc<FnSystem<(Ph, Ph, Ph, Ph, Ph), F>>
where F: FnMut() + Send + 'static,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, RW, EW> From<F> for SystemDesc<FnSystem<(Ph, Ph, Ph, RW, EW), F>>
where F: FnMut(ResWrite<'_, RW>, EntWrite<'_, EW>) + Send + 'static, RW: ResQueryMut, EW: EntQueryMut,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, RW> From<F> for SystemDesc<FnSystem<(Ph, Ph, Ph, RW, Ph), F>>
where F: FnMut(ResWrite<'_, RW>) + Send + 'static, RW: ResQueryMut,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, RR, EW> From<F> for SystemDesc<FnSystem<(Ph, Ph, RR, Ph, EW), F>>
where F: FnMut(ResRead<'_, RR>, EntWrite<'_, EW>) + Send + 'static, RR: ResQuery, EW: EntQueryMut,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, RR> From<F> for SystemDesc<FnSystem<(Ph, Ph, RR, Ph, Ph), F>>
where F: FnMut(ResRead<'_, RR>) + Send + 'static, RR: ResQuery,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, RR, RW, EW> From<F> for SystemDesc<FnSystem<(Ph, Ph, RR, RW, EW), F>>
where F: FnMut(ResRead<'_, RR>, ResWrite<'_, RW>, EntWrite<'_, EW>) + Send + 'static, RR: ResQuery, RW: ResQueryMut, EW: EntQueryMut,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, RR, RW> From<F> for SystemDesc<FnSystem<(Ph, Ph, RR, RW, Ph), F>>
where F: FnMut(ResRead<'_, RR>, ResWrite<'_, RW>) + Send + 'static, RR: ResQuery, RW: ResQueryMut,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, W, EW> From<F> for SystemDesc<FnSystem<(Ph, W, Ph, Ph, EW), F>>
where F: FnMut(Write<'_, W>, EntWrite<'_, EW>) + Send + 'static, W: QueryMut, EW: EntQueryMut,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, W> From<F> for SystemDesc<FnSystem<(Ph, W, Ph, Ph, Ph), F>>
where F: FnMut(Write<'_, W>) + Send + 'static, W: QueryMut,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, W, RW, EW> From<F> for SystemDesc<FnSystem<(Ph, W, Ph, RW, EW), F>>
where F: FnMut(Write<'_, W>, ResWrite<'_, RW>, EntWrite<'_, EW>) + Send + 'static, W: QueryMut, RW: ResQueryMut, EW: EntQueryMut,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, W, RW> From<F> for SystemDesc<FnSystem<(Ph, W, Ph, RW, Ph), F>>
where F: FnMut(Write<'_, W>, ResWrite<'_, RW>) + Send + 'static, W: QueryMut, RW: ResQueryMut,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, W, RR, EW> From<F> for SystemDesc<FnSystem<(Ph, W, RR, Ph, EW), F>>
where F: FnMut(Write<'_, W>, ResRead<'_, RR>, EntWrite<'_, EW>) + Send + 'static, W: QueryMut, RR: ResQuery, EW: EntQueryMut,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, W, RR> From<F> for SystemDesc<FnSystem<(Ph, W, RR, Ph, Ph), F>>
where F: FnMut(Write<'_, W>, ResRead<'_, RR>) + Send + 'static, W: QueryMut, RR: ResQuery,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, W, RR, RW, EW> From<F> for SystemDesc<FnSystem<(Ph, W, RR, RW, EW), F>>
where F: FnMut(Write<'_, W>, ResRead<'_, RR>, ResWrite<'_, RW>, EntWrite<'_, EW>) + Send + 'static, W: QueryMut, RR: ResQuery, RW: ResQueryMut, EW: EntQueryMut,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, W, RR, RW> From<F> for SystemDesc<FnSystem<(Ph, W, RR, RW, Ph), F>>
where F: FnMut(Write<'_, W>, ResRead<'_, RR>, ResWrite<'_, RW>) + Send + 'static, W: QueryMut, RR: ResQuery, RW: ResQueryMut,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, R, EW> From<F> for SystemDesc<FnSystem<(R, Ph, Ph, Ph, EW), F>>
where F: FnMut(Read<'_, R>, EntWrite<'_, EW>) + Send + 'static, R: Query, EW: EntQueryMut,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, R> From<F> for SystemDesc<FnSystem<(R, Ph, Ph, Ph, Ph), F>>
where F: FnMut(Read<'_, R>) + Send + 'static, R: Query,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, R, RW, EW> From<F> for SystemDesc<FnSystem<(R, Ph, Ph, RW, EW), F>>
where F: FnMut(Read<'_, R>, ResWrite<'_, RW>, EntWrite<'_, EW>) + Send + 'static, R: Query, RW: ResQueryMut, EW: EntQueryMut,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, R, RW> From<F> for SystemDesc<FnSystem<(R, Ph, Ph, RW, Ph), F>>
where F: FnMut(Read<'_, R>, ResWrite<'_, RW>) + Send + 'static, R: Query, RW: ResQueryMut,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, R, RR, EW> From<F> for SystemDesc<FnSystem<(R, Ph, RR, Ph, EW), F>>
where F: FnMut(Read<'_, R>, ResRead<'_, RR>, EntWrite<'_, EW>) + Send + 'static, R: Query, RR: ResQuery, EW: EntQueryMut,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, R, RR> From<F> for SystemDesc<FnSystem<(R, Ph, RR, Ph, Ph), F>>
where F: FnMut(Read<'_, R>, ResRead<'_, RR>) + Send + 'static, R: Query, RR: ResQuery,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, R, RR, RW, EW> From<F> for SystemDesc<FnSystem<(R, Ph, RR, RW, EW), F>>
where F: FnMut(Read<'_, R>, ResRead<'_, RR>, ResWrite<'_, RW>, EntWrite<'_, EW>) + Send + 'static, R: Query, RR: ResQuery, RW: ResQueryMut, EW: EntQueryMut,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, R, RR, RW> From<F> for SystemDesc<FnSystem<(R, Ph, RR, RW, Ph), F>>
where F: FnMut(Read<'_, R>, ResRead<'_, RR>, ResWrite<'_, RW>) + Send + 'static, R: Query, RR: ResQuery, RW: ResQueryMut,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, R, W, EW> From<F> for SystemDesc<FnSystem<(R, W, Ph, Ph, EW), F>>
where F: FnMut(Read<'_, R>, Write<'_, W>, EntWrite<'_, EW>) + Send + 'static, R: Query, W: QueryMut, EW: EntQueryMut,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, R, W> From<F> for SystemDesc<FnSystem<(R, W, Ph, Ph, Ph), F>>
where F: FnMut(Read<'_, R>, Write<'_, W>) + Send + 'static, R: Query, W: QueryMut,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, R, W, RW, EW> From<F> for SystemDesc<FnSystem<(R, W, Ph, RW, EW), F>>
where F: FnMut(Read<'_, R>, Write<'_, W>, ResWrite<'_, RW>, EntWrite<'_, EW>) + Send + 'static, R: Query, W: QueryMut, RW: ResQueryMut, EW: EntQueryMut,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, R, W, RW> From<F> for SystemDesc<FnSystem<(R, W, Ph, RW, Ph), F>>
where F: FnMut(Read<'_, R>, Write<'_, W>, ResWrite<'_, RW>) + Send + 'static, R: Query, W: QueryMut, RW: ResQueryMut,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, R, W, RR, EW> From<F> for SystemDesc<FnSystem<(R, W, RR, Ph, EW), F>>
where F: FnMut(Read<'_, R>, Write<'_, W>, ResRead<'_, RR>, EntWrite<'_, EW>) + Send + 'static, R: Query, W: QueryMut, RR: ResQuery, EW: EntQueryMut,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, R, W, RR> From<F> for SystemDesc<FnSystem<(R, W, RR, Ph, Ph), F>>
where F: FnMut(Read<'_, R>, Write<'_, W>, ResRead<'_, RR>) + Send + 'static, R: Query, W: QueryMut, RR: ResQuery,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, R, W, RR, RW, EW> From<F> for SystemDesc<FnSystem<(R, W, RR, RW, EW), F>>
where F: FnMut(Read<'_, R>, Write<'_, W>, ResRead<'_, RR>, ResWrite<'_, RW>, EntWrite<'_, EW>) + Send + 'static, R: Query, W: QueryMut, RR: ResQuery, RW: ResQueryMut, EW: EntQueryMut,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<F, R, W, RR, RW> From<F> for SystemDesc<FnSystem<(R, W, RR, RW, Ph), F>>
where F: FnMut(Read<'_, R>, Write<'_, W>, ResRead<'_, RR>, ResWrite<'_, RW>) + Send + 'static, R: Query, W: QueryMut, RR: ResQuery, RW: ResQueryMut,

Source§

fn from(value: F) -> Self

Converts to this type from the input type.
Source§

impl<T: System> From<T> for SystemDesc<T>

Source§

fn from(value: T) -> Self

Converts to this type from the input type.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.