Skip to main content

RpcClient

Struct RpcClient 

Source
pub struct RpcClient<T: RpcTransport + 'static> { /* private fields */ }

Implementations§

Source§

impl<T: RpcTransport + 'static> RpcClient<T>

Source

pub fn new(transport: Arc<T>, caller_actor: impl Into<String>) -> Self

Source

pub fn caller_actor(&self) -> &str

Source

pub async fn call_raw( &self, method: &str, request: Value, ) -> Result<Value, RpcCallError>

Source

pub fn server_stream_raw( &self, method: &str, request: Value, ) -> UnboundedReceiver<Result<Value, RpcError>>

Source

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.

Source

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.

Source

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.

Source

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).

Source

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.

Source

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.

Source

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.

Source

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<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V