Trait cfxcore::pos::protocol::request_manager::request_handler::Request
source · 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.