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

Function send_ws_response

src/environmentd/src/http/sql.rs:483–489  ·  view source on GitHub ↗

Sends a single [`WebSocketResponse`] over the provided [`WebSocket`].

(ws: &mut WebSocket, resp: WebSocketResponse)

Source from the content-addressed store, hash-verified

481
482/// Sends a single [`WebSocketResponse`] over the provided [`WebSocket`].
483async fn send_ws_response(ws: &mut WebSocket, resp: WebSocketResponse) -> Result<(), Error> {
484 let msg = serde_json::to_string(&resp).unwrap();
485 let msg = Message::Text(msg.into());
486 ws.send(msg).await?;
487
488 Ok(())
489}
490
491/// Forwards a collection of Notices to the provided [`WebSocket`].
492async fn forward_notices(

Callers 3

run_wsFunction · 0.85
forward_noticesFunction · 0.85
add_resultMethod · 0.85

Calls 4

to_stringFunction · 0.85
TextClass · 0.85
unwrapMethod · 0.80
sendMethod · 0.45

Tested by

no test coverage detected