pub trait Handle {
type Request: for<'de> Deserialize<'de> + Send + Sync + Clone + 'static;
type Response: Serialize + Send;
// Required method
fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
method: &'life1 str,
req: Option<Self::Request>,
) -> Pin<Box<dyn Future<Output = Result<Option<Self::Response>, RPCError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided method
fn batch_handle<'life0, 'async_trait>(
&'life0 self,
reqests: Vec<RPCRequest<Option<Self::Request>>>,
) -> Pin<Box<dyn Future<Output = Vec<RPCResponse<Self::Response>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
}Required Associated Types§
type Request: for<'de> Deserialize<'de> + Send + Sync + Clone + 'static
type Response: Serialize + Send
Required Methods§
fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
method: &'life1 str,
req: Option<Self::Request>,
) -> Pin<Box<dyn Future<Output = Result<Option<Self::Response>, RPCError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Provided Methods§
fn batch_handle<'life0, 'async_trait>(
&'life0 self,
reqests: Vec<RPCRequest<Option<Self::Request>>>,
) -> Pin<Box<dyn Future<Output = Vec<RPCResponse<Self::Response>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".