Struct jsonrpc::EndpointHandler
[−]
[src]
pub struct EndpointHandler { pub output: EndpointOutput, pub request_handler: Box<RequestHandler>, }
Combine an EndpointOutput with a request handler, to provide a full Endpoint capable of handling incoming requests from a message reader.
See also: EndpointOutput
Fields
output: EndpointOutput
request_handler: Box<RequestHandler>
Methods
impl EndpointHandler
[src]
fn create_with_output<WRITER>(msg_writer: WRITER,
request_handler: Box<RequestHandler>)
-> EndpointHandler where WRITER: MessageWriter + 'static + Send
request_handler: Box<RequestHandler>)
-> EndpointHandler where WRITER: MessageWriter + 'static + Send
fn create_with_output_agent(output_agent: OutputAgent,
request_handler: Box<RequestHandler>)
-> EndpointHandler
request_handler: Box<RequestHandler>)
-> EndpointHandler
fn create(output: EndpointOutput,
request_handler: Box<RequestHandler>)
-> EndpointHandler
request_handler: Box<RequestHandler>)
-> EndpointHandler
fn run_message_read_loop<MSG_READER: ?Sized>(self,
input: &mut MSG_READER)
-> GResult<()> where MSG_READER: MessageReader
input: &mut MSG_READER)
-> GResult<()> where MSG_READER: MessageReader
Run a message read loop with given message reader. Loop will be terminated only when there is an error reading a message.
TODO: also provide a way for message handling to terminate the loop?
fn handle_incoming_message(&mut self, message_json: &str)
Handle an incoming message
fn handle_incoming_request(&mut self, request: Request)
Handle a well-formed incoming JsonRpc request object