pub struct EndpointHandler {
pub endpoint: Endpoint,
pub request_handler: Box<dyn RequestHandler>,
}
Expand description
Combine an Endpoint with a request handler, to create a complete Endpoint Handler, capable of handling incoming requests from a message reader.
See also: Endpoint
Fields§
§endpoint: Endpoint
§request_handler: Box<dyn RequestHandler>
Implementations§
Source§impl EndpointHandler
impl EndpointHandler
pub fn create_with_writer<WRITER>(
msg_writer: WRITER,
request_handler: Box<dyn RequestHandler>,
) -> EndpointHandlerwhere
WRITER: MessageWriter + 'static + Send,
pub fn create_with_output_agent( output_agent: OutputAgent, request_handler: Box<dyn RequestHandler>, ) -> EndpointHandler
pub fn create( endpoint: Endpoint, request_handler: Box<dyn RequestHandler>, ) -> EndpointHandler
Sourcepub fn run_message_read_loop<MSG_READER>(
self,
input: &mut MSG_READER,
) -> GResult<()>where
MSG_READER: MessageReader + ?Sized,
pub fn run_message_read_loop<MSG_READER>(
self,
input: &mut MSG_READER,
) -> GResult<()>where
MSG_READER: MessageReader + ?Sized,
Run a message read loop with given message reader. Loop will be terminated only when there is an error reading a message.
Sourcepub fn handle_incoming_message(&mut self, message_json: &str)
pub fn handle_incoming_message(&mut self, message_json: &str)
Handle an incoming message
Sourcepub fn handle_incoming_request(&mut self, request: Request)
pub fn handle_incoming_request(&mut self, request: Request)
Handle a well-formed incoming JsonRpc request object
Auto Trait Implementations§
impl Freeze for EndpointHandler
impl !RefUnwindSafe for EndpointHandler
impl !Send for EndpointHandler
impl !Sync for EndpointHandler
impl Unpin for EndpointHandler
impl !UnwindSafe for EndpointHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more