Skip to main content

ClientboundPayloads

Trait ClientboundPayloads 

pub trait ClientboundPayloads {
    // Required method
    fn send_erased(
        &mut self,
        player: u128,
        token: PayloadToken,
        body: &[u8],
    ) -> Result<(), PayloadSendError>;
}
Expand description

The server’s send service: encoded payloads to one player’s client. Object-safe; the typed send helper encodes a value and delegates to this one erased operation.

Required Methods§

fn send_erased( &mut self, player: u128, token: PayloadToken, body: &[u8], ) -> Result<(), PayloadSendError>

Queues body, the encoded value of token’s payload, for player’s client. Ok means accepted for sending, not delivered. Implementations must call PayloadToken::admit with their own frozen declaration table first.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§