Struct specs::RunArg [] [src]

pub struct RunArg {
    // some fields omitted
}

System closure run-time argument.

Methods

impl RunArg
[src]

fn fetch<'a, U, F>(&'a self, f: F) -> U where F: FnOnce(&'a World) -> U

Borrows the world, allowing the system to lock some components and get the entity iterator. Must be called only once.

fn fetch_new<'a, U, F>(&'a self, num_entities: usize, f: F) -> (Vec<Entity>, U) where F: FnOnce(&'a World) -> U

Borrows the world, allowing the system to lock some components and get the entity iterator. As an alternative to fetch(), it must be called only once. It allows creating a number of entities instantly, returned in a vector.

fn create(&self) -> Entity

Creates a new entity dynamically.

fn delete(&self, entity: Entity)

Deletes an entity dynamically.