Struct jsonrpc_core::control::HandlerInternal
[−]
[src]
pub struct HandlerInternal<A, B, C, D> { /* fields omitted */ }
Response handler with transformations.
Methods
impl<A: 'static, B: 'static, C: 'static, D: 'static> HandlerInternal<A, B, C, D>
[src]
fn new<X, G, H>(handler: X, send_mapper: G, notify_mapper: H) -> Self where X: ResponseHandler<A, B> + 'static, G: Fn(C) -> A + Send + 'static, H: Fn(D) -> B + Send + 'static
Create a new HandlerInternal
with given transformation function.
fn map<E, F, G, H>(self,
send_map: G,
notify_map: H)
-> HandlerInternal<A, B, E, F> where G: Fn(E) -> C + Send + 'static, H: Fn(F) -> D + Send + 'static
send_map: G,
notify_map: H)
-> HandlerInternal<A, B, E, F> where G: Fn(E) -> C + Send + 'static, H: Fn(F) -> D + Send + 'static
Convert this HandlerInternal
into a new one, accepting different input.
fn split_map<E, F, G, H>(self,
count: usize,
map_send: G,
map_notify: H)
-> Vec<HandlerInternal<(), (), E, F>> where E: Send + 'static, F: Send + 'static, G: Fn(Vec<E>) -> C + Send + 'static, H: Fn(F) -> D + Send + 'static
count: usize,
map_send: G,
map_notify: H)
-> Vec<HandlerInternal<(), (), E, F>> where E: Send + 'static, F: Send + 'static, G: Fn(Vec<E>) -> C + Send + 'static, H: Fn(F) -> D + Send + 'static
Split this handler into count
handlers.
Upstream ResponseHandler::send
will be called only when all sub-handlers receive a response for the first time.
Notifications are forwarded and mapped through map_single