pub trait AsyncRpcFunc<T>:
Send
+ Sync
+ 'static {
type Resp: Serialize + ToRPCType + 'static;
type Fut: Future<Output = Result<Self::Resp>> + Send + 'static;
// Required method
fn call(&self, req: T) -> Self::Fut;
}Expand description
A trait that captures the relationship between a request type T and its async response.
Required Associated Types§
type Resp: Serialize + ToRPCType + 'static
type Fut: Future<Output = Result<Self::Resp>> + Send + 'static
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".