pub enum MessageCommand {
SendMessage {
target_id: TheaterId,
message: ActorMessage,
response_tx: Sender<Result<()>>,
},
OpenChannel {
initiator_id: ChannelParticipant,
target_id: ChannelParticipant,
channel_id: ChannelId,
initial_message: Vec<u8>,
response_tx: Sender<Result<bool>>,
},
ChannelMessage {
channel_id: ChannelId,
sender_id: ChannelParticipant,
message: Vec<u8>,
response_tx: Sender<Result<()>>,
},
ChannelClose {
channel_id: ChannelId,
sender_id: ChannelParticipant,
response_tx: Sender<Result<()>>,
},
}Expand description
§Message Command
Commands for the message-server handler’s messaging infrastructure.
§Purpose
MessageCommand provides a separate command space from TheaterCommand specifically for actor-to-actor messaging operations. This separation allows the message-server handler to manage messaging independently from the core runtime.
§Design
MessageCommand enables complete architectural separation:
- External MessageRouter manages actor registry
- Message routing is handled externally from the runtime
- Handlers register themselves during setup_host_functions
§Integration
Actor WASM host functions send MessageCommands to route messages:
- send() → MessageCommand::SendMessage
- request() → MessageCommand::SendMessage (with Request type)
- open-channel() → MessageCommand::OpenChannel
- send-on-channel() → MessageCommand::ChannelMessage
- close-channel() → MessageCommand::ChannelClose
Variants§
SendMessage
Send a one-way message to an actor
Delivers a message to the target actor’s mailbox without waiting for a response.
OpenChannel
Open a bidirectional channel between actors
Initiates a channel creation between two participants. The target actor receives a ChannelOpen message and can accept or reject the channel.
ChannelMessage
Send a message on an established channel
Transmits data over an existing channel to the other participant.
Fields
sender_id: ChannelParticipantChannelClose
Close a channel
Terminates a channel, notifying both participants.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MessageCommand
impl !RefUnwindSafe for MessageCommand
impl Send for MessageCommand
impl Sync for MessageCommand
impl Unpin for MessageCommand
impl UnsafeUnpin for MessageCommand
impl !UnwindSafe for MessageCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more