MCPcopy Create free account
hub / github.com/Apress/practical-rust-web-projects / on_frame

Method on_frame

Ch04/websocket/examples/unresponsive_client.rs:9–20  ·  view source on GitHub ↗
(
        &mut self,
        frame: Frame,
    )

Source from the content-addressed store, hash-verified

7}
8impl ws::Handler for Client {
9 fn on_frame(
10 &mut self,
11 frame: Frame,
12 ) -> Result<Option<Frame>> {
13 if frame.opcode() == OpCode::Ping {
14 println!(
15 "Received a ping, but we are not responding"
16 );
17 }
18
19 Ok(None)
20 }
21}
22
23fn main() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected