Skip to main content

RpcClient

Trait RpcClient 

Source
pub trait RpcClient: Send + Sync {
Show 14 methods // Required methods fn call<'life0, 'async_trait>( &'life0 self, payload: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn call_for_service<'life0, 'life1, 'async_trait>( &'life0 self, service_domain: &'life1 str, payload: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn call_for_service_with_method<'life0, 'life1, 'async_trait>( &'life0 self, service_domain: &'life1 str, method_discriminator: u16, payload: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn call_with_options<'life0, 'async_trait>( &'life0 self, payload: Vec<u8>, options: CallOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn call_with_options_for_service<'life0, 'life1, 'async_trait>( &'life0 self, service_domain: &'life1 str, payload: Vec<u8>, options: CallOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn call_streaming<'life0, 'async_trait>( &'life0 self, payload: Vec<u8>, ephemeral_pubkey: [u8; 32], ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn call_streaming_for_service<'life0, 'life1, 'async_trait>( &'life0 self, service_domain: &'life1 str, payload: Vec<u8>, ephemeral_pubkey: [u8; 32], ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn call_streaming_for_service_with_method<'life0, 'life1, 'async_trait>( &'life0 self, service_domain: &'life1 str, method_discriminator: u16, payload: Vec<u8>, ephemeral_pubkey: [u8; 32], ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn open_stream<'life0, 'async_trait>( &'life0 self, payload: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn StreamHandle>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn open_stream_from_info<'life0, 'async_trait>( &'life0 self, stream_info: StreamInfo, client_secret: [u8; 32], client_pubkey: [u8; 32], ) -> Pin<Box<dyn Future<Output = Result<Box<dyn StreamHandle>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn next_id(&self) -> u64; // Provided methods fn call_with_options_for_service_with_method<'life0, 'life1, 'async_trait>( &'life0 self, service_domain: &'life1 str, method_discriminator: u16, payload: Vec<u8>, options: CallOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn call_streaming_with_options_for_service<'life0, 'life1, 'async_trait>( &'life0 self, service_domain: &'life1 str, payload: Vec<u8>, ephemeral_pubkey: [u8; 32], options: CallOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn call_streaming_with_options_for_service_with_method<'life0, 'life1, 'async_trait>( &'life0 self, service_domain: &'life1 str, method_discriminator: u16, payload: Vec<u8>, ephemeral_pubkey: [u8; 32], options: CallOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... }
}
Expand description

Object-safe RPC client trait for dynamic dispatch.

Generated portable clients use Arc<dyn RpcClient> so they work with any RpcClientImpl<S, T> regardless of concrete signer/transport.

Required Methods§

Source

fn call<'life0, 'async_trait>( &'life0 self, payload: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send a request and return the verified response payload.

Source

fn call_for_service<'life0, 'life1, 'async_trait>( &'life0 self, service_domain: &'life1 str, payload: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send a request bound to a canonical destination service.

Source

fn call_for_service_with_method<'life0, 'life1, 'async_trait>( &'life0 self, service_domain: &'life1 str, method_discriminator: u16, payload: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send a generated request with an explicit canonical schema method id.

Source

fn call_with_options<'life0, 'async_trait>( &'life0 self, payload: Vec<u8>, options: CallOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send a request with per-call authentication options.

Uses options.jwt if provided, otherwise falls back to the client’s default JWT. Includes options.delegated_bearer in the envelope.

Source

fn call_with_options_for_service<'life0, 'life1, 'async_trait>( &'life0 self, service_domain: &'life1 str, payload: Vec<u8>, options: CallOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send an option-bearing request bound to a canonical destination.

Source

fn call_streaming<'life0, 'async_trait>( &'life0 self, payload: Vec<u8>, ephemeral_pubkey: [u8; 32], ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send a streaming request with ephemeral DH pubkey.

Source

fn call_streaming_for_service<'life0, 'life1, 'async_trait>( &'life0 self, service_domain: &'life1 str, payload: Vec<u8>, ephemeral_pubkey: [u8; 32], ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send a streaming setup request bound to a canonical destination.

Source

fn call_streaming_for_service_with_method<'life0, 'life1, 'async_trait>( &'life0 self, service_domain: &'life1 str, method_discriminator: u16, payload: Vec<u8>, ephemeral_pubkey: [u8; 32], ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send a generated streaming request with an explicit schema method id.

Source

fn open_stream<'life0, 'async_trait>( &'life0 self, payload: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn StreamHandle>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Open a verified streaming subscription.

Source

fn open_stream_from_info<'life0, 'async_trait>( &'life0 self, stream_info: StreamInfo, client_secret: [u8; 32], client_pubkey: [u8; 32], ) -> Pin<Box<dyn Future<Output = Result<Box<dyn StreamHandle>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Open a verified stream from pre-parsed StreamInfo + ephemeral keys.

Source

fn next_id(&self) -> u64

Get the next request ID.

Provided Methods§

Source

fn call_with_options_for_service_with_method<'life0, 'life1, 'async_trait>( &'life0 self, service_domain: &'life1 str, method_discriminator: u16, payload: Vec<u8>, options: CallOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn call_streaming_with_options_for_service<'life0, 'life1, 'async_trait>( &'life0 self, service_domain: &'life1 str, payload: Vec<u8>, ephemeral_pubkey: [u8; 32], options: CallOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn call_streaming_with_options_for_service_with_method<'life0, 'life1, 'async_trait>( &'life0 self, service_domain: &'life1 str, method_discriminator: u16, payload: Vec<u8>, ephemeral_pubkey: [u8; 32], options: CallOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§

Source§

impl<S: Signer, T: Transport + 'static> RpcClient for RpcClientImpl<S, T>

Blanket impl: any RpcClientImpl<S, T> satisfies RpcClient.