pub struct DispatchMessage<T> { /* private fields */ }Expand description
A live message carrying an owner-thread callback context through a send-safe channel.
Conversion with From<T> creates independent ingress without capturing a callback root.
External-thread sends and sends without an active root are also independent ingress.
Rooted messages must be processed on
their owner’s thread. Foreign-thread destruction releases the root at the next owner
channel boundary, callback quiescence check, or dispatcher teardown.
Implementations§
Source§impl<T> DispatchMessage<T>
impl<T> DispatchMessage<T>
Sourcepub fn new(message: T, owner: ThreadId) -> Self
pub fn new(message: T, owner: ThreadId) -> Self
Wraps a message, capturing callback ancestry only when called on owner.
owner is the runtime thread that processes messages from this channel.
§Panics
Panics if the owner exhausts its channel context IDs.
Source§impl DispatchMessage<TradingCommandMessage>
impl DispatchMessage<TradingCommandMessage>
Sourcepub fn dispatch_trading(self, before: impl FnMut(&TradingCommandMessage))
pub fn dispatch_trading(self, before: impl FnMut(&TradingCommandMessage))
Dispatches the command and its deferred children under their captured callback roots.
Calls before immediately before each endpoint dispatch, including child commands.
§Panics
Panics if:
- A rooted message is processed outside its owner thread.
- The observer or a command handler panics.