pub struct FnSystem<Req, F> { /* private fields */ }Expand description
A system that is FnMut.
The purpose of this type is to remove boilerplate code related to system
declaration when clients make systems using functions. Unlike types like
struct or enum, functions have parameters which explains what types the
functions need. The crate exploits the information then makes boilerplate
code for clients.
Plus, there is FnOnceSystem for FnOnce.
- Req - Arbitrary length of parameters of
F. - F - Function.
Trait Implementations§
Source§impl<F, R, W, RR, RW, EW> From<F> for FnSystem<(R, W, RR, RW, EW), F>
impl<F, R, W, RR, RW, EW> From<F> for FnSystem<(R, W, RR, RW, EW), F>
Source§impl<F, EW> System for FnSystem<(Ph, Ph, Ph, Ph, EW), F>
impl<F, EW> System for FnSystem<(Ph, Ph, Ph, Ph, EW), F>
type Request = ((), (), (), (), EW)
Source§fn run(&mut self, _resp: Response<'_, Self::Request>)
fn run(&mut self, _resp: Response<'_, Self::Request>)
Runs the system with the response corresponding to its request.
Source§fn on_transition(&mut self, from: SystemState, to: SystemState)
fn on_transition(&mut self, from: SystemState, to: SystemState)
Does a certain behavior on transitions of system state. Read more
Source§impl<F> System for FnSystem<(Ph, Ph, Ph, Ph, Ph), F>
impl<F> System for FnSystem<(Ph, Ph, Ph, Ph, Ph), F>
type Request = ((), (), (), (), ())
Source§fn run(&mut self, _resp: Response<'_, Self::Request>)
fn run(&mut self, _resp: Response<'_, Self::Request>)
Runs the system with the response corresponding to its request.
Source§fn on_transition(&mut self, from: SystemState, to: SystemState)
fn on_transition(&mut self, from: SystemState, to: SystemState)
Does a certain behavior on transitions of system state. Read more
Source§impl<F, RW, EW> System for FnSystem<(Ph, Ph, Ph, RW, EW), F>
impl<F, RW, EW> System for FnSystem<(Ph, Ph, Ph, RW, EW), F>
type Request = ((), (), (), RW, EW)
Source§fn run(&mut self, _resp: Response<'_, Self::Request>)
fn run(&mut self, _resp: Response<'_, Self::Request>)
Runs the system with the response corresponding to its request.
Source§fn on_transition(&mut self, from: SystemState, to: SystemState)
fn on_transition(&mut self, from: SystemState, to: SystemState)
Does a certain behavior on transitions of system state. Read more
Source§impl<F, RW> System for FnSystem<(Ph, Ph, Ph, RW, Ph), F>
impl<F, RW> System for FnSystem<(Ph, Ph, Ph, RW, Ph), F>
type Request = ((), (), (), RW, ())
Source§fn run(&mut self, _resp: Response<'_, Self::Request>)
fn run(&mut self, _resp: Response<'_, Self::Request>)
Runs the system with the response corresponding to its request.
Source§fn on_transition(&mut self, from: SystemState, to: SystemState)
fn on_transition(&mut self, from: SystemState, to: SystemState)
Does a certain behavior on transitions of system state. Read more
Source§impl<F, RR, EW> System for FnSystem<(Ph, Ph, RR, Ph, EW), F>
impl<F, RR, EW> System for FnSystem<(Ph, Ph, RR, Ph, EW), F>
type Request = ((), (), RR, (), EW)
Source§fn run(&mut self, _resp: Response<'_, Self::Request>)
fn run(&mut self, _resp: Response<'_, Self::Request>)
Runs the system with the response corresponding to its request.
Source§fn on_transition(&mut self, from: SystemState, to: SystemState)
fn on_transition(&mut self, from: SystemState, to: SystemState)
Does a certain behavior on transitions of system state. Read more
Source§impl<F, RR> System for FnSystem<(Ph, Ph, RR, Ph, Ph), F>
impl<F, RR> System for FnSystem<(Ph, Ph, RR, Ph, Ph), F>
type Request = ((), (), RR, (), ())
Source§fn run(&mut self, _resp: Response<'_, Self::Request>)
fn run(&mut self, _resp: Response<'_, Self::Request>)
Runs the system with the response corresponding to its request.
Source§fn on_transition(&mut self, from: SystemState, to: SystemState)
fn on_transition(&mut self, from: SystemState, to: SystemState)
Does a certain behavior on transitions of system state. Read more
Source§impl<F, RR, RW, EW> System for FnSystem<(Ph, Ph, RR, RW, EW), F>
impl<F, RR, RW, EW> System for FnSystem<(Ph, Ph, RR, RW, EW), F>
type Request = ((), (), RR, RW, EW)
Source§fn run(&mut self, _resp: Response<'_, Self::Request>)
fn run(&mut self, _resp: Response<'_, Self::Request>)
Runs the system with the response corresponding to its request.
Source§fn on_transition(&mut self, from: SystemState, to: SystemState)
fn on_transition(&mut self, from: SystemState, to: SystemState)
Does a certain behavior on transitions of system state. Read more
Source§impl<F, RR, RW> System for FnSystem<(Ph, Ph, RR, RW, Ph), F>
impl<F, RR, RW> System for FnSystem<(Ph, Ph, RR, RW, Ph), F>
type Request = ((), (), RR, RW, ())
Source§fn run(&mut self, _resp: Response<'_, Self::Request>)
fn run(&mut self, _resp: Response<'_, Self::Request>)
Runs the system with the response corresponding to its request.
Source§fn on_transition(&mut self, from: SystemState, to: SystemState)
fn on_transition(&mut self, from: SystemState, to: SystemState)
Does a certain behavior on transitions of system state. Read more
Source§impl<F, W, EW> System for FnSystem<(Ph, W, Ph, Ph, EW), F>
impl<F, W, EW> System for FnSystem<(Ph, W, Ph, Ph, EW), F>
Source§impl<F, W> System for FnSystem<(Ph, W, Ph, Ph, Ph), F>
impl<F, W> System for FnSystem<(Ph, W, Ph, Ph, Ph), F>
Source§impl<F, W, RW, EW> System for FnSystem<(Ph, W, Ph, RW, EW), F>
impl<F, W, RW, EW> System for FnSystem<(Ph, W, Ph, RW, EW), F>
Source§impl<F, W, RW> System for FnSystem<(Ph, W, Ph, RW, Ph), F>
impl<F, W, RW> System for FnSystem<(Ph, W, Ph, RW, Ph), F>
Source§impl<F, W, RR, EW> System for FnSystem<(Ph, W, RR, Ph, EW), F>
impl<F, W, RR, EW> System for FnSystem<(Ph, W, RR, Ph, EW), F>
Source§impl<F, W, RR> System for FnSystem<(Ph, W, RR, Ph, Ph), F>
impl<F, W, RR> System for FnSystem<(Ph, W, RR, Ph, Ph), F>
Source§impl<F, W, RR, RW, EW> System for FnSystem<(Ph, W, RR, RW, EW), F>
impl<F, W, RR, RW, EW> System for FnSystem<(Ph, W, RR, RW, EW), F>
type Request = ((), W, RR, RW, EW)
Source§fn run(&mut self, _resp: Response<'_, Self::Request>)
fn run(&mut self, _resp: Response<'_, Self::Request>)
Runs the system with the response corresponding to its request.
Source§fn on_transition(&mut self, from: SystemState, to: SystemState)
fn on_transition(&mut self, from: SystemState, to: SystemState)
Does a certain behavior on transitions of system state. Read more
Source§impl<F, W, RR, RW> System for FnSystem<(Ph, W, RR, RW, Ph), F>
impl<F, W, RR, RW> System for FnSystem<(Ph, W, RR, RW, Ph), F>
Source§impl<F, R, EW> System for FnSystem<(R, Ph, Ph, Ph, EW), F>
impl<F, R, EW> System for FnSystem<(R, Ph, Ph, Ph, EW), F>
Source§impl<F, R> System for FnSystem<(R, Ph, Ph, Ph, Ph), F>
impl<F, R> System for FnSystem<(R, Ph, Ph, Ph, Ph), F>
Source§impl<F, R, RW, EW> System for FnSystem<(R, Ph, Ph, RW, EW), F>
impl<F, R, RW, EW> System for FnSystem<(R, Ph, Ph, RW, EW), F>
Source§impl<F, R, RW> System for FnSystem<(R, Ph, Ph, RW, Ph), F>
impl<F, R, RW> System for FnSystem<(R, Ph, Ph, RW, Ph), F>
Source§impl<F, R, RR, EW> System for FnSystem<(R, Ph, RR, Ph, EW), F>
impl<F, R, RR, EW> System for FnSystem<(R, Ph, RR, Ph, EW), F>
Source§impl<F, R, RR> System for FnSystem<(R, Ph, RR, Ph, Ph), F>
impl<F, R, RR> System for FnSystem<(R, Ph, RR, Ph, Ph), F>
Source§impl<F, R, RR, RW, EW> System for FnSystem<(R, Ph, RR, RW, EW), F>
impl<F, R, RR, RW, EW> System for FnSystem<(R, Ph, RR, RW, EW), F>
type Request = (R, (), RR, RW, EW)
Source§fn run(&mut self, _resp: Response<'_, Self::Request>)
fn run(&mut self, _resp: Response<'_, Self::Request>)
Runs the system with the response corresponding to its request.
Source§fn on_transition(&mut self, from: SystemState, to: SystemState)
fn on_transition(&mut self, from: SystemState, to: SystemState)
Does a certain behavior on transitions of system state. Read more
Source§impl<F, R, RR, RW> System for FnSystem<(R, Ph, RR, RW, Ph), F>
impl<F, R, RR, RW> System for FnSystem<(R, Ph, RR, RW, Ph), F>
Source§impl<F, R, W, EW> System for FnSystem<(R, W, Ph, Ph, EW), F>
impl<F, R, W, EW> System for FnSystem<(R, W, Ph, Ph, EW), F>
Source§impl<F, R, W> System for FnSystem<(R, W, Ph, Ph, Ph), F>
impl<F, R, W> System for FnSystem<(R, W, Ph, Ph, Ph), F>
Source§impl<F, R, W, RW, EW> System for FnSystem<(R, W, Ph, RW, EW), F>
impl<F, R, W, RW, EW> System for FnSystem<(R, W, Ph, RW, EW), F>
type Request = (R, W, (), RW, EW)
Source§fn run(&mut self, _resp: Response<'_, Self::Request>)
fn run(&mut self, _resp: Response<'_, Self::Request>)
Runs the system with the response corresponding to its request.
Source§fn on_transition(&mut self, from: SystemState, to: SystemState)
fn on_transition(&mut self, from: SystemState, to: SystemState)
Does a certain behavior on transitions of system state. Read more
Source§impl<F, R, W, RW> System for FnSystem<(R, W, Ph, RW, Ph), F>
impl<F, R, W, RW> System for FnSystem<(R, W, Ph, RW, Ph), F>
Source§impl<F, R, W, RR, EW> System for FnSystem<(R, W, RR, Ph, EW), F>
impl<F, R, W, RR, EW> System for FnSystem<(R, W, RR, Ph, EW), F>
type Request = (R, W, RR, (), EW)
Source§fn run(&mut self, _resp: Response<'_, Self::Request>)
fn run(&mut self, _resp: Response<'_, Self::Request>)
Runs the system with the response corresponding to its request.
Source§fn on_transition(&mut self, from: SystemState, to: SystemState)
fn on_transition(&mut self, from: SystemState, to: SystemState)
Does a certain behavior on transitions of system state. Read more
Source§impl<F, R, W, RR> System for FnSystem<(R, W, RR, Ph, Ph), F>
impl<F, R, W, RR> System for FnSystem<(R, W, RR, Ph, Ph), F>
Source§impl<F, R, W, RR, RW, EW> System for FnSystem<(R, W, RR, RW, EW), F>
impl<F, R, W, RR, RW, EW> System for FnSystem<(R, W, RR, RW, EW), F>
type Request = (R, W, RR, RW, EW)
Source§fn run(&mut self, _resp: Response<'_, Self::Request>)
fn run(&mut self, _resp: Response<'_, Self::Request>)
Runs the system with the response corresponding to its request.
Source§fn on_transition(&mut self, from: SystemState, to: SystemState)
fn on_transition(&mut self, from: SystemState, to: SystemState)
Does a certain behavior on transitions of system state. Read more
Source§impl<F, R, W, RR, RW> System for FnSystem<(R, W, RR, RW, Ph), F>
impl<F, R, W, RR, RW> System for FnSystem<(R, W, RR, RW, Ph), F>
type Request = (R, W, RR, RW, ())
Source§fn run(&mut self, _resp: Response<'_, Self::Request>)
fn run(&mut self, _resp: Response<'_, Self::Request>)
Runs the system with the response corresponding to its request.
Source§fn on_transition(&mut self, from: SystemState, to: SystemState)
fn on_transition(&mut self, from: SystemState, to: SystemState)
Does a certain behavior on transitions of system state. Read more
impl<Req, F: Send> Send for FnSystem<Req, F>
Auto Trait Implementations§
impl<Req, F> Freeze for FnSystem<Req, F>where
F: Freeze,
impl<Req, F> RefUnwindSafe for FnSystem<Req, F>where
F: RefUnwindSafe,
Req: RefUnwindSafe,
impl<Req, F> Sync for FnSystem<Req, F>
impl<Req, F> Unpin for FnSystem<Req, F>
impl<Req, F> UnwindSafe for FnSystem<Req, F>where
F: UnwindSafe,
Req: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more