MCPcopy Index your code
hub / github.com/Rust-Web-Development/code / oneshot

Method oneshot

ch_11/mock-server/src/lib.rs:71–84  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

69 }
70
71 pub fn oneshot(&self) -> OneshotHandler {
72 let (tx, rx) = oneshot::channel::<i32>();
73 let routes = Self::build_routes();
74
75 let (_, server) = warp::serve(routes).bind_with_graceful_shutdown(self.socket, async {
76 rx.await.ok();
77 });
78
79 tokio::task::spawn(server);
80
81 OneshotHandler {
82 sender: tx,
83 }
84 }
85}

Callers 1

run_mockFunction · 0.80

Calls 1

build_routesFunction · 0.85

Tested by

no test coverage detected