pub trait PubSubRpcHandler:
Clone
+ Send
+ Sync
+ Unpin
+ 'static {
type Request: DeserializeOwned + Send + Sync + Debug;
type SubscriptionId: Hash + PartialEq + Eq + Send + Sync + Debug;
type Subscription: Stream<Item = Value> + Send + Sync + Unpin;
// Required method
fn on_request(
&self,
request: Self::Request,
cx: PubSubContext<Self>,
) -> impl Future<Output = ResponseResult> + Send;
}Expand description
The general purpose trait for handling RPC requests and subscriptions
Required Associated Types§
Required Methods§
Sourcefn on_request(
&self,
request: Self::Request,
cx: PubSubContext<Self>,
) -> impl Future<Output = ResponseResult> + Send
fn on_request( &self, request: Self::Request, cx: PubSubContext<Self>, ) -> impl Future<Output = ResponseResult> + Send
Invoked when the request was received
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".