Add fn EventState::send<M: Debug + 'static>(&mut self, id: Id, msg: M) to send a type-erased message to a designated target
Add fn ConfigCx::push<M: Debug + 'static>(&mut self, id: Id, msg: M) to emit a type-erased message from configure/update
Currently the second method is just a wrapper around the first, but (a) there might be a distinction between "push/emit a reusable message" and "send a non-reusable message" in the future and (b) ConfigCxmight gain an embedded Id for the current widget, in which case push would lose the id parameter (but send would not).
fn EventState::send<M: Debug + 'static>(&mut self, id: Id, msg: M)
to send a type-erased message to a designated targetfn ConfigCx::push<M: Debug + 'static>(&mut self, id: Id, msg: M)
to emit a type-erased message from configure/updateCurrently the second method is just a wrapper around the first, but (a) there might be a distinction between "push/emit a reusable message" and "send a non-reusable message" in the future and (b)
ConfigCx
might gain an embeddedId
for the current widget, in which casepush
would lose theid
parameter (butsend
would not).Since it's now possible to send a message,
handle_messages
cannot assume that a message comes from a child.