System

Trait System 

Source
pub trait System<Args, Ret> {
    // Required methods
    fn execute(&mut self, context: &Context<'_>) -> Result<()>;
    fn name(&self) -> SystemName;
    fn borrows() -> Borrows;

    // Provided method
    fn named<S: Into<Cow<'static, str>>>(self, name: S) -> NamedSystem<Self>
       where Self: Sized { ... }
}
Expand description

Trait which defines any function or type that can operate on a world or other context.

Required Methods§

Source

fn execute(&mut self, context: &Context<'_>) -> Result<()>

Executes the by borrowing from context

Source

fn name(&self) -> SystemName

Returns the system name. Used for debug purposes

Source

fn borrows() -> Borrows

Returns which data will be accessed

Provided Methods§

Source

fn named<S: Into<Cow<'static, str>>>(self, name: S) -> NamedSystem<Self>
where Self: Sized,

Wrap the system with a custom name

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.

Implementors§

Source§

impl<Err, Func, L> System<(L,), Result<(), Err>> for Func
where Err: Into<Error>, for<'a, 'b> &'b mut Func: FnMut(L) -> Result<(), Err> + FnMut(<L::Borrow as ContextBorrow<'a>>::Target) -> Result<(), Err>, L: IntoBorrow + ComponentBorrow,

Source§

impl<Err, Func, L, K> System<(L, K), Result<(), Err>> for Func
where Err: Into<Error>, for<'a, 'b> &'b mut Func: FnMut(L, K) -> Result<(), Err> + FnMut(<L::Borrow as ContextBorrow<'a>>::Target, <K::Borrow as ContextBorrow<'a>>::Target) -> Result<(), Err>, L: IntoBorrow + ComponentBorrow, K: IntoBorrow + ComponentBorrow,

Source§

impl<Err, Func, L, K, J> System<(L, K, J), Result<(), Err>> for Func
where Err: Into<Error>, for<'a, 'b> &'b mut Func: FnMut(L, K, J) -> Result<(), Err> + FnMut(<L::Borrow as ContextBorrow<'a>>::Target, <K::Borrow as ContextBorrow<'a>>::Target, <J::Borrow as ContextBorrow<'a>>::Target) -> Result<(), Err>, L: IntoBorrow + ComponentBorrow, K: IntoBorrow + ComponentBorrow, J: IntoBorrow + ComponentBorrow,

Source§

impl<Err, Func, L, K, J, I> System<(L, K, J, I), Result<(), Err>> for Func
where Err: Into<Error>, for<'a, 'b> &'b mut Func: FnMut(L, K, J, I) -> Result<(), Err> + FnMut(<L::Borrow as ContextBorrow<'a>>::Target, <K::Borrow as ContextBorrow<'a>>::Target, <J::Borrow as ContextBorrow<'a>>::Target, <I::Borrow as ContextBorrow<'a>>::Target) -> Result<(), Err>, L: IntoBorrow + ComponentBorrow, K: IntoBorrow + ComponentBorrow, J: IntoBorrow + ComponentBorrow, I: IntoBorrow + ComponentBorrow,

Source§

impl<Err, Func, L, K, J, I, H> System<(L, K, J, I, H), Result<(), Err>> for Func

Source§

impl<Err, Func, L, K, J, I, H, G> System<(L, K, J, I, H, G), Result<(), Err>> for Func

Source§

impl<Err, Func, L, K, J, I, H, G, F> System<(L, K, J, I, H, G, F), Result<(), Err>> for Func

Source§

impl<Err, Func, L, K, J, I, H, G, F, E> System<(L, K, J, I, H, G, F, E), Result<(), Err>> for Func

Source§

impl<Err, Func, L, K, J, I, H, G, F, E, D> System<(L, K, J, I, H, G, F, E, D), Result<(), Err>> for Func

Source§

impl<Err, Func, L, K, J, I, H, G, F, E, D, C> System<(L, K, J, I, H, G, F, E, D, C), Result<(), Err>> for Func

Source§

impl<Err, Func, L, K, J, I, H, G, F, E, D, C, B> System<(L, K, J, I, H, G, F, E, D, C, B), Result<(), Err>> for Func

Source§

impl<Err, Func, L, K, J, I, H, G, F, E, D, C, B, A> System<(L, K, J, I, H, G, F, E, D, C, B, A), Result<(), Err>> for Func

Source§

impl<Err: Into<Error>, F: FnMut() -> Result<(), Err>> System<(), Result<(), Err>> for F

Source§

impl<F: FnMut()> System<(), ()> for F

Source§

impl<F: System<Args, Ret>, Args, Ret> System<Args, Ret> for NamedSystem<F>

Source§

impl<Func, L> System<(L,), ()> for Func
where for<'a, 'b> &'b mut Func: FnMut(L) + FnMut(<L::Borrow as ContextBorrow<'a>>::Target), L: IntoBorrow + ComponentBorrow,

Source§

impl<Func, L, K> System<(L, K), ()> for Func

Source§

impl<Func, L, K, J> System<(L, K, J), ()> for Func

Source§

impl<Func, L, K, J, I> System<(L, K, J, I), ()> for Func

Source§

impl<Func, L, K, J, I, H> System<(L, K, J, I, H), ()> for Func

Source§

impl<Func, L, K, J, I, H, G> System<(L, K, J, I, H, G), ()> for Func

Source§

impl<Func, L, K, J, I, H, G, F> System<(L, K, J, I, H, G, F), ()> for Func

Source§

impl<Func, L, K, J, I, H, G, F, E> System<(L, K, J, I, H, G, F, E), ()> for Func

Source§

impl<Func, L, K, J, I, H, G, F, E, D> System<(L, K, J, I, H, G, F, E, D), ()> for Func

Source§

impl<Func, L, K, J, I, H, G, F, E, D, C> System<(L, K, J, I, H, G, F, E, D, C), ()> for Func

Source§

impl<Func, L, K, J, I, H, G, F, E, D, C, B> System<(L, K, J, I, H, G, F, E, D, C, B), ()> for Func

Source§

impl<Func, L, K, J, I, H, G, F, E, D, C, B, A> System<(L, K, J, I, H, G, F, E, D, C, B, A), ()> for Func