pub trait ModuleMessage: Message {
    // Provided methods
    fn send(&self, target: Target) { ... }
    fn send_local_broadcast(&self, include_self: bool) { ... }
    fn send_local(&self, target_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(MessageContext, 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, include_self: bool)

Sends a message to every package on this side.

include_self controls whether or not the message is sent to the package that originally sent the message.

source

fn send_local(&self, target_id: EntityId)

Sends a message to a specific package or module on this side.

source

fn send_server_unreliable(&self)

Available on crate feature client only.

Sends an unreliable message to the server.

Note that this message will only be received by the corresponding package on the server, and not by any other packages. You will need to explicitly relay the message to other packages on the server.

See Target::ServerUnreliable for details.

source

fn send_server_reliable(&self)

Available on crate feature client only.

Sends a reliable message to the server.

Note that this message will only be received by the corresponding package on the server, and not by any other packages. You will need to explicitly relay the message to other packages on the server.

See Target::ServerReliable for details.

source

fn send_client_broadcast_unreliable(&self)

Available on crate feature server only.

Sends an unreliable message to all clients.

Note that this message will only be received by the corresponding package on the client, and not by any other packages. You will need to explicitly relay the message to other packages on the client.

See Target::ClientBroadcastUnreliable for details.

source

fn send_client_broadcast_reliable(&self)

Available on crate feature server only.

Sends a reliable message to all clients.

Note that this message will only be received by the corresponding package on the client, and not by any other packages. You will need to explicitly relay the message to other packages on the client.

See Target::ClientBroadcastReliable for details.

source

fn send_client_targeted_unreliable(&self, user_id: String)

Available on crate feature server only.

Sends an unreliable message to a specific client.

Note that this message will only be received by the corresponding package on the client, and not by any other packages. You will need to explicitly relay the message to other packages on the client.

See Target::ClientTargetedUnreliable for details.

source

fn send_client_targeted_reliable(&self, user_id: String)

Available on crate feature server only.

Sends a reliable message to a specific client.

Note that this message will only be received by the corresponding package on the client, and not by any other packages. You will need to explicitly relay the message to other packages on the client.

See Target::ClientTargetedReliable for details.

source

fn subscribe<R>( callback: impl FnMut(MessageContext, Self) -> R + 'static ) -> Listener
where R: CallbackReturn,

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

Object Safety§

This trait is not object safe.

Implementors§