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§

source

fn send(&self, target: Target)

Sends this Message to target. Wrapper around self::send.

source

fn send_local_broadcast(&self)

Sends a message to every module on this side.

source

fn send_local(&self, module_id: EntityId)

Sends a message to a specific module on this side.

source

fn send_server_unreliable(&self)

Available on crate feature client only.

Sends an unreliable message to the server.

See Target::ServerUnreliable for specifics.

source

fn send_server_reliable(&self)

Available on crate feature client only.

Sends a reliable message to the server.

See Target::ServerReliable for specifics.

source

fn send_client_broadcast_unreliable(&self)

Available on crate feature server only.

Sends an unreliable message to all clients.

See Target::ClientBroadcastUnreliable for specifics.

source

fn send_client_broadcast_reliable(&self)

Available on crate feature server only.

Sends a reliable message to all clients.

See Target::ClientBroadcastReliable for specifics.

source

fn send_client_targeted_unreliable(&self, user_id: String)

Available on crate feature server only.

Sends an unreliable message to a specific client.

See Target::ClientTargetedUnreliable for specifics.

source

fn send_client_targeted_reliable(&self, user_id: String)

Available on crate feature server only.

Sends a reliable message to a specific client.

See Target::ClientTargetedReliable for specifics.

source

fn subscribe<R>(callback: impl FnMut(Source, Self) -> R + 'static) -> Listenerwhere R: CallbackReturn,

Subscribes to this Message. Wrapper around self::subscribe.

Implementors§