Trait RpcClient
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>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: '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>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: '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>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn call_with_options<'life0, 'async_trait>(
&'life0 self,
payload: Vec<u8>,
options: CallOptions,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: '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>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: '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>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: '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>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: '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>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn open_stream<'life0, 'async_trait>(
&'life0 self,
payload: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn StreamHandle>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: '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>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: '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>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: '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>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: '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>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: '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§
fn call<'life0, 'async_trait>(
&'life0 self,
payload: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn call<'life0, 'async_trait>(
&'life0 self,
payload: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Send a request and return the verified response payload.
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>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: '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>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Send a request bound to a canonical destination service.
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>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: '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>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Send a generated request with an explicit canonical schema method id.
fn call_with_options<'life0, 'async_trait>(
&'life0 self,
payload: Vec<u8>,
options: CallOptions,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn call_with_options<'life0, 'async_trait>(
&'life0 self,
payload: Vec<u8>,
options: CallOptions,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: '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.
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>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: '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>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Send an option-bearing request bound to a canonical destination.
fn call_streaming<'life0, 'async_trait>(
&'life0 self,
payload: Vec<u8>,
ephemeral_pubkey: [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: '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>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Send a streaming request with ephemeral DH pubkey.
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>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: '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>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Send a streaming setup request bound to a canonical destination.
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>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: '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>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Send a generated streaming request with an explicit schema method id.
fn open_stream<'life0, 'async_trait>(
&'life0 self,
payload: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn StreamHandle>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn open_stream<'life0, 'async_trait>(
&'life0 self,
payload: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn StreamHandle>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Open a verified streaming subscription.
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>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: '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>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Open a verified stream from pre-parsed StreamInfo + ephemeral keys.