Trait 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§

Source

fn timeout(&self, conf: &ProtocolConfiguration) -> Duration

Request timeout for resend purpose.

Source

fn notify_error(&mut self, error: Error)

Notify the handler when error happens for the request.

Source

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.

Implementors§