fn on_message(&mut self, msg: Message) -> Result<()> {
        use Message::*;
        use Payload::*;

        // Broadcast to all connections
        match msg {
            Text(string) => match Payload::from_json(&string) {
                Ok(Reaction { id, .. }) if id == self.id() => self.broadcast(string),
                _ => self.unsupported(string),
            },
            _ => self.unsupported(msg),
        }
    }
// Handle messages recieved in the websocket (in this case, only on /ws)
Handle messages recieved in the websocket (in this case, only on /ws)
Handle messages recieved in the websocket ( in this case only on / ws )
fn on_message(&mut self, msg: Message) -> Result<()> {
        use Message::*;
        use Payload::*;
        // Broadcast to all connections
        match msg {
            Text(string) => match Payload::from_json(&string) {
                Ok(Reaction { id, .. }) if id == self.id() => self.broadcast(string),
                _ => self.unsupported(string),
            },
            _ => self.unsupported(msg),
        }
    }
fn on_message ( & mut self , msg : Message ) -> Result < ( ) > { use Message :: * ; use Payload :: * ; // Broadcast to all connections match msg { Text ( string ) => match Payload :: from_json ( & string ) { Ok ( Reaction { id , .. } ) if id == self . id ( ) => self . broadcast ( string ) , _ => self . unsupported ( string ) , } , _ => self . unsupported ( msg ) , } }
Handle messages recieved in the websocket (in this case, only on /ws)
Handle messages recieved in the websocket ( in this case only on / ws )
&mut self
msg
Message
&mut self
msg
Message