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() -> (Self, UnboundedReceiver<ServerRequest>)
pub fn new() -> (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 async fn laboratory_transfer(
&self,
request: LaboratoryTransferRequest,
) -> Result<u64, McpError>
pub async fn laboratory_transfer( &self, request: LaboratoryTransferRequest, ) -> Result<u64, McpError>
LaboratoryExportBegin: start an export on the conduit and get
its transfer id. Each transfer op below is ONE id-correlated
request/response exchange awaited WITHOUT a deadline — laboratory
transfers are timeout-free unconditionally (never bounded by the
per-request MCP call timeout).
LaboratoryTransfer: hand the WHOLE cross-host client-to-client
transfer to the CLI daemon, which drives the export/import
splice itself. One request, one {bytes} reply — the proxy
never touches payload bytes. Timeout-free like every transfer
op.
Sourcepub async fn laboratory_local_transfer(
&self,
request: LaboratoryLocalTransferRequest,
) -> Result<u64, McpError>
pub async fn laboratory_local_transfer( &self, request: LaboratoryLocalTransferRequest, ) -> Result<u64, McpError>
LaboratoryLocalTransfer: both endpoints share one (machine,
state) — the CLI daemon forwards this verbatim to that one
laboratory host, which pipes the bytes container-to-container.
pub async fn laboratory_export_begin( &self, laboratory_id: String, machine: Option<String>, machine_state: Option<String>, path: String, ) -> Result<String, McpError>
Sourcepub async fn laboratory_export_read(
&self,
transfer_id: String,
) -> Result<LaboratoryExportChunk, McpError>
pub async fn laboratory_export_read( &self, transfer_id: String, ) -> Result<LaboratoryExportChunk, McpError>
LaboratoryExportRead: pull the next chunk.
Sourcepub async fn laboratory_export_abort(&self, transfer_id: String)
pub async fn laboratory_export_abort(&self, transfer_id: String)
LaboratoryExportAbort: best-effort early cleanup.
Sourcepub async fn laboratory_import_begin(
&self,
laboratory_id: String,
machine: Option<String>,
machine_state: Option<String>,
path: String,
) -> Result<String, McpError>
pub async fn laboratory_import_begin( &self, laboratory_id: String, machine: Option<String>, machine_state: Option<String>, path: String, ) -> Result<String, McpError>
LaboratoryImportBegin: start an import on the conduit and get
its transfer id.
Sourcepub async fn laboratory_import_write(
&self,
transfer_id: String,
data: String,
) -> Result<(), McpError>
pub async fn laboratory_import_write( &self, transfer_id: String, data: String, ) -> Result<(), McpError>
LaboratoryImportWrite: push one chunk.
Sourcepub async fn laboratory_import_end(
&self,
transfer_id: String,
) -> Result<u64, McpError>
pub async fn laboratory_import_end( &self, transfer_id: String, ) -> Result<u64, McpError>
LaboratoryImportEnd: close the body and get the byte total.
Sourcepub async fn laboratory_import_abort(&self, transfer_id: String)
pub async fn laboratory_import_abort(&self, transfer_id: String)
LaboratoryImportAbort: best-effort early cleanup.
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