Trait ambient_api::message::ModuleMessage
source · pub trait ModuleMessage: Message {
// Provided methods
fn send(&self, target: Target) { ... }
fn send_local_broadcast(&self) { ... }
fn send_local(&self, module_id: EntityId) { ... }
fn send_server_unreliable(&self) { ... }
fn send_server_reliable(&self) { ... }
fn send_client_broadcast_unreliable(&self) { ... }
fn send_client_broadcast_reliable(&self) { ... }
fn send_client_targeted_unreliable(&self, user_id: String) { ... }
fn send_client_targeted_reliable(&self, user_id: String) { ... }
fn subscribe<R>(
callback: impl FnMut(Source, Self) -> R + 'static
) -> Listener
where R: CallbackReturn { ... }
}
Expand description
Implemented by all messages that can be sent between modules.
Provided Methods§
sourcefn send(&self, target: Target)
fn send(&self, target: Target)
Sends this Message to target
. Wrapper around self::send.
sourcefn send_local_broadcast(&self)
fn send_local_broadcast(&self)
Sends a message to every module on this side.
sourcefn send_local(&self, module_id: EntityId)
fn send_local(&self, module_id: EntityId)
Sends a message to a specific module on this side.
sourcefn send_server_unreliable(&self)
fn send_server_unreliable(&self)
client
only.Sends an unreliable message to the server.
See Target::ServerUnreliable for specifics.
sourcefn send_server_reliable(&self)
fn send_server_reliable(&self)
client
only.Sends a reliable message to the server.
See Target::ServerReliable for specifics.
sourcefn send_client_broadcast_unreliable(&self)
fn send_client_broadcast_unreliable(&self)
server
only.Sends an unreliable message to all clients.
See Target::ClientBroadcastUnreliable for specifics.
sourcefn send_client_broadcast_reliable(&self)
fn send_client_broadcast_reliable(&self)
server
only.Sends a reliable message to all clients.
See Target::ClientBroadcastReliable for specifics.
sourcefn send_client_targeted_unreliable(&self, user_id: String)
fn send_client_targeted_unreliable(&self, user_id: String)
server
only.Sends an unreliable message to a specific client.
See Target::ClientTargetedUnreliable for specifics.
sourcefn send_client_targeted_reliable(&self, user_id: String)
fn send_client_targeted_reliable(&self, user_id: String)
server
only.Sends a reliable message to a specific client.
See Target::ClientTargetedReliable for specifics.
sourcefn subscribe<R>(callback: impl FnMut(Source, Self) -> R + 'static) -> Listenerwhere
R: CallbackReturn,
fn subscribe<R>(callback: impl FnMut(Source, Self) -> R + 'static) -> Listenerwhere R: CallbackReturn,
Subscribes to this Message. Wrapper around self::subscribe.