Trait Request

Source
pub trait Request: 'static {
    type Read: Query;
    type Write: QueryMut;
    type ResRead: ResQuery;
    type ResWrite: ResQueryMut;
    type EntWrite: EntQueryMut;
}
Expand description

A system request for a components, resources, and entity containers.

All systems must declare their own requests in advance. The crate exploits the information to avoid data race and dead-lock between systems. A request consists of read and write requests like so,

  • Read - Read request for a set of components.
  • Write - Write request for a set of components.
  • ResRead - Read request for a set of resources.
  • ResWrite - Write request for a set of resources.
  • EntWrite - Write request for a set of entity containers.

Required Associated Types§

Source

type Read: Query

Source

type Write: QueryMut

Source

type ResRead: ResQuery

Source

type ResWrite: ResQueryMut

Source

type EntWrite: EntQueryMut

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Request for ()

Empty request.

Source§

impl<R, W, RR, RW, EW> Request for (R, W, RR, RW, EW)
where R: Query, W: QueryMut, RR: ResQuery, RW: ResQueryMut, EW: EntQueryMut,

Blanket implementation of Request for tuples of queries.

Source§

type Read = R

Source§

type Write = W

Source§

type ResRead = RR

Source§

type ResWrite = RW

Source§

type EntWrite = EW

Implementors§