Closed strohel closed 3 years ago
Another option would be to add ?Sized to the generic param of Context and Addr, as they only need Actor::Message to be sized, but not Actor itself. I don't know if one is preferred over the other?
Oh, that's interesting. ?Sized
would make the API somewhat more flexible - but I'm unable to come up with a particular use-case. Implementing Actor
for dyn OtherTrait
?
Perhaps a pragmatic approach is to only add ?Sized
when Sized
comes out to be restrictive.
Yeah, I can not really think of unsized actor use case, either. But it may still be good to keep the trait constraint-free until it becomes necessary. Up to you :) I don't feel strongly either way.
I've submitted the alternative proposal in https://github.com/tonarino/actor/pull/25
If nobody has a preference, then let's merge the other one and close this one.
All Actor trait methods had a Sized bound. It should be equivalent to put the bound on the whole trait.
Or perhaps there is some reason not to?