Macro mesh_worker::runnable_workers
source · macro_rules! runnable_workers { ( $name:ident { $($(#[$vattr:meta])* $worker:ty),*$(,)? } ) => { ... }; }
Expand description
Generates a type that defines the set of workers that can be run by a worker host. Generate a type to that can be used to match a requested worker name and run it.
The resulting type is an empty struct implementing the WorkerFactory
trait.
This is used to enumerate the list of worker types a host can instantiate.
Workers can be conditionally enabled by tagging them with a corresponding #[cfg]
attr.
§Example
runnable_workers! {
RunnableWorkers {
MyWorker1,
#[cfg(unix)]
MyWorker2,
}
}