pub struct Dispatch { /* private fields */ }Expand description
What the UI may ask of the features a segment can reach.
emit takes the action by value, so what is happening is readable where it
happens. Nothing comes back: the answer arrives as an update to a reducer.
That is why everything the UI needs has to be state - “compute this for me
on demand” does not exist - and the same fact is why teardown is safe,
since nobody is ever waiting on something that has gone.
No actor appears anywhere in this path. An action is a value the domain
answers; how it answers - an actor, a task with a RefCell, a channel to
a thread - is the domain’s own business and may change without anything
outside noticing. An actor named in a signature would be exactly the leak
this avoids, and the compiler says so out loud: it makes the actor public.
What is still checked at build time is the part that matters: actor!
asserts Handler<M> for every action it lists, so an action nobody answers
fails to compile inside the domain. What is left to run time is whether
the feature is installed here at all - which was never a type’s question.