[][src]Struct specs_task::TaskManager

pub struct TaskManager<'a> { /* fields omitted */ }

The main object for users of this module. Used for creating and connecting tasks.

Methods

impl<'_> TaskManager<'_>[src]

pub fn make_task_with_entity<'a, T: TaskComponent<'a>>(
    &mut self,
    entity: Entity,
    task: T,
    tasks: &mut WriteStorage<T>
)
[src]

Like make_task, but use entity for tracking the task components. This can make it easier to manage tasks coupled with a specific entity (rather than storing a separate task entity in a component).

pub fn make_task<'a, T: TaskComponent<'a>>(
    &mut self,
    task: T,
    tasks: &mut WriteStorage<T>
) -> Entity
[src]

Create a new task entity with the given TaskComponent. The task will not make progress until it is either finalized or the descendent of a finalized entity.

pub fn make_final_task_with_entity<'a, T: TaskComponent<'a>>(
    &mut self,
    entity: Entity,
    task: T,
    tasks: &mut WriteStorage<T>,
    on_completion: OnCompletion
) -> Entity
[src]

Same as make_task_with_entity, but also finalizes the task.

pub fn make_final_task<'a, T: TaskComponent<'a>>(
    &mut self,
    task: T,
    tasks: &mut WriteStorage<T>,
    on_completion: OnCompletion
) -> Entity
[src]

Same as make_task, but also finalizes the task.

pub fn make_fork(&mut self) -> Entity[src]

Create a new fork entity with no children.

pub fn add_prong(
    &mut self,
    fork_entity: Entity,
    prong: Entity
) -> Result<(), UnexpectedEntity>
[src]

Add prong as a child on the MultiEdge of fork_entity.

pub fn join(
    &mut self,
    parent: Entity,
    child: Entity
) -> Result<(), AlreadyJoined>
[src]

Creates a SingleEdge from parent to child. Creates a fork-join if parent is a fork.

pub fn finalize(&mut self, entity: Entity, on_completion: OnCompletion)[src]

Mark entity as final. This will make all of entity's descendents visible to the TaskManagerSystem, allowing them to make progress. If OnCompletion::Delete, then entity and all of its descendents will be deleted when entity is complete (and hence the entire graph is complete). Otherwise, you need to clean up the entities your self by calling delete_entity_and_descendents. God help you if you leak an orphaned entity.

pub fn task_is_complete(&self, entity: Entity) -> bool[src]

Returns true iff the task was seen as complete on the last run of the TaskManagerSystem.

WARNING: assumes that this entity was at one point a task, and it can't tell otherwise.

pub fn entity_is_complete(&self, entity: Entity) -> bool[src]

Tells you whether a fork or a task entity is complete.

WARNING: assumes that this entity was at one point a task or a fork, and it can't tell otherwise.

pub fn count_tasks_in_progress(&self) -> usize[src]

Returns the number of tasks that haven't yet completed.

pub fn delete_descendents(&self, entity: Entity)[src]

Deletes only the descendent entities of entity, but leaves entity alive.

pub fn delete_entity_and_descendents(&self, entity: Entity)[src]

Deletes entity and all of its descendents.

Trait Implementations

impl<'a> SystemData<'a> for TaskManager<'a> where
    Entities<'a>: SystemData<'a>,
    WriteStorage<'a, TaskProgress>: SystemData<'a>,
    WriteStorage<'a, SingleEdge>: SystemData<'a>,
    WriteStorage<'a, MultiEdge>: SystemData<'a>,
    WriteStorage<'a, FinalTag>: SystemData<'a>, 
[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for TaskManager<'a>

impl<'a> Send for TaskManager<'a>

impl<'a> Sync for TaskManager<'a>

impl<'a> Unpin for TaskManager<'a>

impl<'a> !UnwindSafe for TaskManager<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T> DynamicSystemData<'a> for T where
    T: SystemData<'a>, 

type Accessor = StaticAccessor<T>

The accessor of the SystemData, which specifies the read and write dependencies and does the fetching. Read more

impl<T> Event for T where
    T: Send + Sync + 'static, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Resource for T where
    T: Any + Send + Sync

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.