Skip to main content

ReplicationHandler

Trait ReplicationHandler 

Source
pub trait ReplicationHandler:
    Send
    + Sync
    + 'static {
    // Required methods
    fn broadcast(&self, message: Bytes);
    fn send_to(&self, peer: &[u8], message: Bytes);
}
Expand description

Callback trait for sending messages to peers.

Required Methods§

Source

fn broadcast(&self, message: Bytes)

Send a message to all connected peers.

Source

fn send_to(&self, peer: &[u8], message: Bytes)

Send a message to a specific peer.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§