Hi, I'd like to pass a type parameter in the data contained inside states. Here's an example of what I hope to do:
pub struct State<M> {
pids: Vec<Pid>,
config: WorkerConfig,
phantom: PhantomData<M>,
}
machine! {
#[derive(Clone, Debug, PartialEq)]
pub enum WorkerSet<M> {
Startup { state: State<M> }, // This currently complains.
Running { state: State<M> }, // same.
}
}
I feel the code above is natural seems right. Unfortunately, it looks like the code for the struct representations in each state enum variant end up without the type parameter and so I can't parameterize that type /:
Is there a workaround for this, or am I out of luck?
Hi, I'd like to pass a type parameter in the data contained inside states. Here's an example of what I hope to do:
I feel the code above is natural seems right. Unfortunately, it looks like the code for the struct representations in each state enum variant end up without the type parameter and so I can't parameterize that type /:
Is there a workaround for this, or am I out of luck?