MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / server

Function server

src/mz/src/server.rs:86–98  ·  view source on GitHub ↗

Server for handling login's information.

(
    tx: UnboundedSender<Result<AppPassword, Error>>,
)

Source from the content-addressed store, hash-verified

84
85/// Server for handling login's information.
86pub async fn server(
87 tx: UnboundedSender<Result<AppPassword, Error>>,
88) -> (impl Future<Output = Result<(), std::io::Error>>, u16) {
89 let app = Router::new().route("/", get(|body| request(body, tx)));
90 let addr = SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::LOCALHOST, 0));
91 let listener = TcpListener::bind(addr).await.unwrap_or_else(|e| {
92 panic!("error binding to {}: {}", addr, e);
93 });
94 let port = listener.local_addr().unwrap().port();
95 let server = axum::serve(listener, app.into_make_service());
96
97 (server.into_future(), port)
98}

Callers 1

init_with_browserFunction · 0.85

Calls 8

requestFunction · 0.85
routeMethod · 0.80
unwrapMethod · 0.80
getFunction · 0.50
serveFunction · 0.50
portMethod · 0.45
local_addrMethod · 0.45
into_futureMethod · 0.45

Tested by

no test coverage detected