| 60 | } |
| 61 | |
| 62 | pub trait RpcCall<State>: Sized { |
| 63 | type PrpcService: PrpcService + From<Self> + Send + 'static; |
| 64 | |
| 65 | fn construct(context: CallContext<'_, State>) -> Result<Self>; |
| 66 | |
| 67 | async fn call( |
| 68 | self, |
| 69 | method: String, |
| 70 | payload: Vec<u8>, |
| 71 | is_json: bool, |
| 72 | is_query: bool, |
| 73 | ) -> (u16, Vec<u8>) { |
| 74 | dispatch_prpc( |
| 75 | method, |
| 76 | payload, |
| 77 | is_json, |
| 78 | is_query, |
| 79 | <Self::PrpcService as From<Self>>::from(self), |
| 80 | ) |
| 81 | .await |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | async fn dispatch_prpc( |
| 86 | path: String, |
no outgoing calls
no test coverage detected