pub struct RpcClient<T: RpcTransport + 'static> { /* private fields */ }Implementations§
Source§impl<T: RpcTransport + 'static> RpcClient<T>
impl<T: RpcTransport + 'static> RpcClient<T>
pub fn new(transport: Arc<T>, caller_actor: impl Into<String>) -> Self
pub fn caller_actor(&self) -> &str
pub async fn call_raw( &self, method: &str, request: Value, ) -> Result<Value, RpcCallError>
pub fn server_stream_raw( &self, method: &str, request: Value, ) -> UnboundedReceiver<Result<Value, RpcError>>
Sourcepub fn subscribe_raw(
&self,
method: &str,
request: Value,
topic: Option<String>,
) -> UnboundedReceiver<Result<Value, RpcError>>
pub fn subscribe_raw( &self, method: &str, request: Value, topic: Option<String>, ) -> UnboundedReceiver<Result<Value, RpcError>>
Subscribe — server-streaming variant. The server emits a seq=-1
subscribed ack frame at the start and a seq=-1, more=false
unsubscribed trailer at the end. The returned receiver only
yields the real event payloads in between.
Sourcepub fn client_stream_raw(
&self,
method: &str,
request: Value,
requests_rx: UnboundedReceiver<Result<Value, RpcError>>,
) -> Pin<Box<dyn Future<Output = Result<Value, RpcCallError>> + Send>>
pub fn client_stream_raw( &self, method: &str, request: Value, requests_rx: UnboundedReceiver<Result<Value, RpcError>>, ) -> Pin<Box<dyn Future<Output = Result<Value, RpcCallError>> + Send>>
Client-streaming. The handler receives the initial request plus
every value the caller pushes through requests_rx; it returns
the single aggregated response.
Sourcepub fn bidi_raw(
&self,
method: &str,
request: Value,
) -> (UnboundedSender<Result<Value, RpcError>>, UnboundedReceiver<Result<Value, RpcError>>)
pub fn bidi_raw( &self, method: &str, request: Value, ) -> (UnboundedSender<Result<Value, RpcError>>, UnboundedReceiver<Result<Value, RpcError>>)
Bidi-streaming. Returns (tx, rx): caller sends client values into
tx, receives server values from rx. Closing tx ends the
client side; the server’s stream end terminates rx.
Sourcepub fn command_channel_raw(
&self,
method: &str,
request: Value,
) -> (UnboundedSender<Result<Value, RpcError>>, UnboundedReceiver<Result<Value, RpcError>>)
pub fn command_channel_raw( &self, method: &str, request: Value, ) -> (UnboundedSender<Result<Value, RpcError>>, UnboundedReceiver<Result<Value, RpcError>>)
Command-channel — bidi with credit-based backpressure. Server
emits an initial credit grant frame on accept; we surface that as
part of the transport flow but the receiver just sees the data
frames (the credit grant rides on seq=-1 and is filtered out).
Sourcepub fn bulk_transfer_raw(
&self,
method: &str,
request: Value,
chunks: &[Vec<u8>],
) -> Pin<Box<dyn Future<Output = Result<Value, RpcCallError>> + Send>>
pub fn bulk_transfer_raw( &self, method: &str, request: Value, chunks: &[Vec<u8>], ) -> Pin<Box<dyn Future<Output = Result<Value, RpcCallError>> + Send>>
Bulk-transfer — client-streamed byte chunks with a final SHA-256
hash assertion. The client computes the hash up-front and ships it
in ext.bulk.expected_hash; the server recomputes and compares.
Sourcepub fn telemetry_raw(
&self,
method: &str,
request: Value,
frames_rx: UnboundedReceiver<Result<Value, RpcError>>,
priority: StreamingPriority,
) -> Pin<Box<dyn Future<Output = Result<(), RpcCallError>> + Send>>
pub fn telemetry_raw( &self, method: &str, request: Value, frames_rx: UnboundedReceiver<Result<Value, RpcError>>, priority: StreamingPriority, ) -> Pin<Box<dyn Future<Output = Result<(), RpcCallError>> + Send>>
Telemetry — push-only client-streaming with no aggregated response.
The runtime emits a closing rpc-response status=ok with
ext.streaming_priority set so the future resolves cleanly.
Sourcepub fn remote_shell_raw(
&self,
method: &str,
request: Value,
stdin_rx: UnboundedReceiver<Vec<u8>>,
) -> UnboundedReceiver<Result<RemoteShellOut, RpcError>>
pub fn remote_shell_raw( &self, method: &str, request: Value, stdin_rx: UnboundedReceiver<Vec<u8>>, ) -> UnboundedReceiver<Result<RemoteShellOut, RpcError>>
Remote-shell — client emits stdin chunks, server emits
(stream, data) records tagged stdin/stdout/stderr.
Sourcepub fn agent_session_raw(
&self,
method: &str,
request: Value,
initial_chain: Vec<String>,
frames_rx: UnboundedReceiver<AgentSessionFrame>,
) -> UnboundedReceiver<Result<AgentSessionFrame, RpcError>>
pub fn agent_session_raw( &self, method: &str, request: Value, initial_chain: Vec<String>, frames_rx: UnboundedReceiver<AgentSessionFrame>, ) -> UnboundedReceiver<Result<AgentSessionFrame, RpcError>>
Agent-session — bidi that propagates a delegation chain on every
frame. The handler receives {value, responsibility_chain} records
and emits the same shape; the chain is copied into
ext.responsibility_chain on each wire frame.
Auto Trait Implementations§
impl<T> Freeze for RpcClient<T>
impl<T> RefUnwindSafe for RpcClient<T>where
T: RefUnwindSafe,
impl<T> Send for RpcClient<T>
impl<T> Sync for RpcClient<T>
impl<T> Unpin for RpcClient<T>
impl<T> UnsafeUnpin for RpcClient<T>
impl<T> UnwindSafe for RpcClient<T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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