pub struct ReverseChannel(/* private fields */);Expand description
Cheaply-cloneable handle the proxy uses to speak over the WS.
Implementations§
Source§impl ReverseChannel
impl ReverseChannel
Sourcepub fn new(timeout: Duration) -> (Self, UnboundedReceiver<ServerRequest>)
pub fn new(timeout: Duration) -> (Self, UnboundedReceiver<ServerRequest>)
Build a channel. Returns the channel plus the receiver the API
drains (serializing each server_request onto the shared WS sink).
Sourcepub fn deliver_response(&self, response: ServerResponse)
pub fn deliver_response(&self, response: ServerResponse)
Hand a proxy-bound server_response (one of the 6 MCP variants)
back to the waiter that issued the matching request. Called by the
API’s recv loop. Unknown id → dropped.
Sourcepub async fn deliver_client_request(&self, request: Request) -> Response
pub async fn deliver_client_request(&self, request: Request) -> Response
Hand a proxy-bound client_request to the proxy.
McpListChanged fires the registered list-changed callback for the
upstream. The MCP-op variants (ListTools/CallTool/
ListResources/ReadResource) resolve the session by
response_id and run the SAME shared [crate::session::Session]
code the HTTP endpoints use — fanning out / routing exactly as
mcp::handle_tools_list etc. — returning the normal MCP result.
NOTE: the CallTool path deliberately does NOT consult the queue
delegate (that splice is only for the regular HTTP tools/call).
Returns the ack/result the API writes back over the WS.
Trait Implementations§
Source§impl Clone for ReverseChannel
impl Clone for ReverseChannel
Source§fn clone(&self) -> ReverseChannel
fn clone(&self) -> ReverseChannel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ReverseChannel
impl !UnwindSafe for ReverseChannel
impl Freeze for ReverseChannel
impl Send for ReverseChannel
impl Sync for ReverseChannel
impl Unpin for ReverseChannel
impl UnsafeUnpin for ReverseChannel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more