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 fn deliver_client_request(&self, request: Request) -> Response
pub fn deliver_client_request(&self, request: Request) -> Response
Hand a proxy-bound client_request (today only McpListChanged)
to the proxy. Fires the registered list-changed callback for the
upstream, and returns the ack 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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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