[][src]Trait goggles::par_seq::System

pub trait System {
    type Source: ?Sized;
    type Resources: Resources;
    type Pool: Pool;
    type Args: ?Sized;
    type Error: Error;
    fn check_resources(&self) -> Result<Self::Resources, ResourceConflict>;
fn run(
        &mut self,
        pool: &Self::Pool,
        source: &Self::Source,
        args: &Self::Args
    ) -> Result<(), Self::Error>; }

A system that may be run in parallel or in sequence with other such systems in a group.

This trait is designed so that systems may read or write to resources inside the source parameter. Systems report the resources they intend to use abstractly through the Resources type, and this provides the ability to check parallel systems for resource conflicts.

Associated Types

Loading content...

Required methods

fn check_resources(&self) -> Result<Self::Resources, ResourceConflict>

Check for any internal resource conficts and if there are none, return a Resources that represents the used resources.

Must be a constant value, this will generally only be called once.

fn run(
    &mut self,
    pool: &Self::Pool,
    source: &Self::Source,
    args: &Self::Args
) -> Result<(), Self::Error>

Loading content...

Implementations on Foreign Types

impl<S: ?Sized> System for Box<S> where
    S: System
[src]

type Source = S::Source

type Resources = S::Resources

type Pool = S::Pool

type Args = S::Args

type Error = S::Error

Loading content...

Implementors

impl<H, T, S, R, P, A, E> System for Seq<H, T> where
    H: System<Source = S, Resources = R, Pool = P, Args = A, Error = E>,
    T: System<Source = S, Resources = R, Pool = P, Args = A, Error = E>,
    S: ?Sized,
    R: Resources,
    P: Pool,
    A: ?Sized,
    E: Error
[src]

type Source = S

type Resources = R

type Pool = P

type Args = A

type Error = E

impl<H, T, S: ?Sized, R, P, A: ?Sized, E> System for Par<H, T> where
    H: System<Source = S, Resources = R, Pool = P, Args = A, Error = E> + Send,
    T: System<Source = S, Resources = R, Pool = P, Args = A, Error = E> + Send,
    S: Sync,
    R: Resources + Send,
    P: Pool + Sync,
    A: Sync,
    E: Error + Send
[src]

type Source = S

type Resources = R

type Pool = P

type Args = A

type Error = E

Loading content...