pub trait RPCSink {
// Required methods
fn send_message(
&mut self,
message: JSONRPCMessage,
) -> impl Future<Output = Result<()>> + Send;
fn send_notification<T: Serialize + Send>(
&mut self,
method: &str,
notification: T,
) -> impl Future<Output = Result<()>> + Send;
fn send_response<T: Serialize + Send>(
&mut self,
request_id: RequestId,
response: T,
) -> impl Future<Output = Result<()>> + Send;
fn request<T: Serialize + Send, R: DeserializeOwned + Send>(
&mut self,
request_id: RequestId,
method: &str,
request: T,
) -> impl Future<Output = Result<Result<R, JSONRPCError>>> + Send;
}
Required Methods§
fn send_message( &mut self, message: JSONRPCMessage, ) -> impl Future<Output = Result<()>> + Send
Sourcefn send_notification<T: Serialize + Send>(
&mut self,
method: &str,
notification: T,
) -> impl Future<Output = Result<()>> + Send
fn send_notification<T: Serialize + Send>( &mut self, method: &str, notification: T, ) -> impl Future<Output = Result<()>> + Send
Send a notification to the peer.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.