mcp_streamable_proxy/proxy_handler/connection_swap.rs
1use super::*;
2
3impl ProxyHandler {
4 /// Update the backend from a high-level client connection.
5 pub fn swap_backend_from_connection(
6 &self,
7 conn: Option<crate::client::StreamClientConnection>,
8 ) {
9 match conn {
10 Some(c) => {
11 let running = c.into_running_service();
12 self.swap_backend(Some(running));
13 }
14 None => {
15 self.swap_backend(None);
16 }
17 }
18 }
19}