|
15 | 15 | //! type Data = ();
|
16 | 16 | //! fn on_connect(self: Arc<Self>, socket: Arc<Socket<()>>) { }
|
17 | 17 | //! fn on_disconnect(&self, socket: Arc<Socket<()>>, reason: DisconnectReason) { }
|
18 |
| -//! fn on_message(&self, msg: Str, socket: Arc<Socket<()>>) { } |
19 |
| -//! fn on_binary(&self, data: Bytes, socket: Arc<Socket<()>>) { } |
| 18 | +//! fn on_message(self: &Arc<Self>, msg: Str, socket: Arc<Socket<()>>) { } |
| 19 | +//! fn on_binary(self: &Arc<Self>, data: Bytes, socket: Arc<Socket<()>>) { } |
20 | 20 | //! }
|
21 | 21 | //!
|
22 | 22 | //! let config = EngineIoConfig::builder()
|
@@ -150,12 +150,12 @@ impl EngineIoConfigBuilder {
|
150 | 150 | /// println!("socket disconnect {}", socket.id);
|
151 | 151 | /// }
|
152 | 152 | ///
|
153 |
| - /// fn on_message(&self, msg: Str, socket: Arc<Socket<()>>) { |
| 153 | + /// fn on_message(self: &Arc<Self>, msg: Str, socket: Arc<Socket<()>>) { |
154 | 154 | /// println!("Ping pong message {:?}", msg);
|
155 | 155 | /// socket.emit(msg).unwrap();
|
156 | 156 | /// }
|
157 | 157 | ///
|
158 |
| - /// fn on_binary(&self, data: Bytes, socket: Arc<Socket<()>>) { |
| 158 | + /// fn on_binary(self: &Arc<Self>, data: Bytes, socket: Arc<Socket<()>>) { |
159 | 159 | /// println!("Ping pong binary message {:?}", data);
|
160 | 160 | /// socket.emit_binary(data).unwrap();
|
161 | 161 | /// }
|
|
0 commit comments