pub trait Request:
Send
+ Debug
+ AsAny
+ Message
+ SetRequestId {
// Required methods
fn timeout(&self, conf: &ProtocolConfiguration) -> Duration;
fn notify_error(&mut self, error: Error);
fn set_response_notification(
&mut self,
res_tx: Sender<Result<Box<dyn RpcResponse>, Error>>,
);
}
Expand description
Trait of request message
Required Methods§
Sourcefn timeout(&self, conf: &ProtocolConfiguration) -> Duration
fn timeout(&self, conf: &ProtocolConfiguration) -> Duration
Request timeout for resend purpose.
Sourcefn notify_error(&mut self, error: Error)
fn notify_error(&mut self, error: Error)
Notify the handler when error happens for the request.
Sourcefn set_response_notification(
&mut self,
res_tx: Sender<Result<Box<dyn RpcResponse>, Error>>,
)
fn set_response_notification( &mut self, res_tx: Sender<Result<Box<dyn RpcResponse>, Error>>, )
This is for RPC request. Set the notification handle for the request.