But obviously dyn Actor<Context = ()> is not Sized. But if I wrap it inside a Box, then the trait actix::actor::Actor is not implemented for std::boxed::Box<(dyn actix::actor::Actor<Context = ()> + 'static)>.
How can I make a Trait that is capable of returning a reference to an actor?
The Driver trait is supposed to be implemented by various structs. Each defining a different Actor struct.
Then this impl Driver structs are to be contained within a HashMap, so, AFAIK, trait objects are necessary here. And unfortunately, Actor trait is Sized so it cannot be used in trait objects.
the trait actix::actor::Actor cannot be made into an object.
Do you have any suggestion to do this without trait objects?