pub trait CallRequestHandler {
    type Reply: Stream<Item = Result<ResponseChunk, Error>> + Unpin;

    // Required method
    fn do_call(
        &mut self,
        request_id: String,
        caller: String,
        address: String,
        data: Vec<u8>,
        no_reply: bool
    ) -> Self::Reply;

    // Provided methods
    fn handle_event(&mut self, caller: String, topic: String, data: Vec<u8>) { ... }
    fn on_disconnect(&mut self) { ... }
}

Required Associated Types§

source

type Reply: Stream<Item = Result<ResponseChunk, Error>> + Unpin

Required Methods§

source

fn do_call( &mut self, request_id: String, caller: String, address: String, data: Vec<u8>, no_reply: bool ) -> Self::Reply

Provided Methods§

source

fn handle_event(&mut self, caller: String, topic: String, data: Vec<u8>)

source

fn on_disconnect(&mut self)

Implementations on Foreign Types§

source§

impl<R: Stream<Item = Result<ResponseChunk, Error>> + Unpin, F1: FnMut(String, String, String, Vec<u8>) -> R, F2: FnMut(String, String, Vec<u8>)> CallRequestHandler for (F1, F2)

§

type Reply = R

source§

fn do_call( &mut self, request_id: String, caller: String, address: String, data: Vec<u8>, _no_reply: bool ) -> Self::Reply

source§

fn handle_event(&mut self, caller: String, topic: String, data: Vec<u8>)

Implementors§