Struct fibers_rpc::server::ServerBuilder
[−]
[src]
pub struct ServerBuilder { /* fields omitted */ }
RPC server builder.
Methods
impl ServerBuilder
[src]
pub fn new(bind_addr: SocketAddr) -> Self
[src]
Makes a new ServerBuilder
instance.
ⓘImportant traits for &'a mut Wpub fn logger(&mut self, logger: Logger) -> &mut Self
[src]
Sets the logger of the server.
The default value is Logger::root(Discard, o!())
.
ⓘImportant traits for &'a mut Wpub fn channel_options(&mut self, options: ChannelOptions) -> &mut Self
[src]
Sets ChannelOptions
used by the service.
The default value is ChannelOptions::default()
.
ⓘImportant traits for &'a mut Wpub fn metrics(&mut self, builder: MetricBuilder) -> &mut Self
[src]
Sets MetricBuilder
used by the service.
The default value is MetricBuilder::new()
.
ⓘImportant traits for &'a mut Wpub fn add_call_handler<T, H>(&mut self, handler: H) -> &mut Self where
T: Call,
H: HandleCall<T>,
T::ReqDecoder: Default,
T::ResEncoder: Default,
[src]
T: Call,
H: HandleCall<T>,
T::ReqDecoder: Default,
T::ResEncoder: Default,
Registers a handler for the request/response RPC.
This equivalent to
add_call_handler_with_codec(handler, DefaultFactory::new(), DefaultFactory::new())
.
Panices
If a procedure which has T::ID
already have been registered, the calling thread will panic.
ⓘImportant traits for &'a mut Wpub fn add_call_handler_with_decoder<T, H, D>(
&mut self,
handler: H,
decoder_factory: D
) -> &mut Self where
T: Call,
H: HandleCall<T>,
D: Factory<Item = T::ReqDecoder> + Send + Sync + 'static,
T::ResEncoder: Default,
[src]
&mut self,
handler: H,
decoder_factory: D
) -> &mut Self where
T: Call,
H: HandleCall<T>,
D: Factory<Item = T::ReqDecoder> + Send + Sync + 'static,
T::ResEncoder: Default,
Registers a handler (with the given decoder maker) for the request/response RPC.
This equivalent to add_call_handler_with_codec(handler, decoder_factory, DefaultFactory::new())
.
Panices
If a procedure which has T::ID
already have been registered, the calling thread will panic.
ⓘImportant traits for &'a mut Wpub fn add_call_handler_with_encoder<T, H, E>(
&mut self,
handler: H,
encoder_factory: E
) -> &mut Self where
T: Call,
H: HandleCall<T>,
E: Factory<Item = T::ResEncoder> + Send + Sync + 'static,
T::ReqDecoder: Default,
[src]
&mut self,
handler: H,
encoder_factory: E
) -> &mut Self where
T: Call,
H: HandleCall<T>,
E: Factory<Item = T::ResEncoder> + Send + Sync + 'static,
T::ReqDecoder: Default,
Registers a handler (with the given encoder maker) for the request/response RPC.
This equivalent to
add_call_handler_with_codec(handler, DefaultFactory::new(), encoder_factory)
.
Panices
If a procedure which has T::ID
already have been registered,
the calling thread will panic.
ⓘImportant traits for &'a mut Wpub fn add_call_handler_with_codec<T, H, D, E>(
&mut self,
handler: H,
decoder_factory: D,
encoder_factory: E
) -> &mut Self where
T: Call,
H: HandleCall<T>,
D: Factory<Item = T::ReqDecoder> + Send + Sync + 'static,
E: Factory<Item = T::ResEncoder> + Send + Sync + 'static,
[src]
&mut self,
handler: H,
decoder_factory: D,
encoder_factory: E
) -> &mut Self where
T: Call,
H: HandleCall<T>,
D: Factory<Item = T::ReqDecoder> + Send + Sync + 'static,
E: Factory<Item = T::ResEncoder> + Send + Sync + 'static,
Registers a handler (with the given decoder/encoder makers) for the request/response RPC.
Panices
If a procedure which has T::ID
already have been registered, the calling thread will panic.
ⓘImportant traits for &'a mut Wpub fn add_cast_handler<T, H>(&mut self, handler: H) -> &mut Self where
T: Cast,
H: HandleCast<T>,
T::Decoder: Default,
[src]
T: Cast,
H: HandleCast<T>,
T::Decoder: Default,
Registers a handler for the notification RPC.
This equivalent to add_cast_handler_with_encoder(handler, DefaultFactory::new())
.
Panices
If a procedure which has T::ID
already have been registered, the calling thread will panic.
ⓘImportant traits for &'a mut Wpub fn add_cast_handler_with_decoder<T, H, D>(
&mut self,
handler: H,
decoder_factory: D
) -> &mut Self where
T: Cast,
H: HandleCast<T>,
D: Factory<Item = T::Decoder> + Send + Sync + 'static,
[src]
&mut self,
handler: H,
decoder_factory: D
) -> &mut Self where
T: Cast,
H: HandleCast<T>,
D: Factory<Item = T::Decoder> + Send + Sync + 'static,
Registers a handler (with the given decoder maker) for the notification RPC.
Panices
If a procedure which has T::ID
already have been registered, the calling thread will panic.
pub fn finish<S>(&mut self, spawner: S) -> Server<S> where
S: Clone + Spawn + Send + 'static,
[src]
S: Clone + Spawn + Send + 'static,
Returns the resulting RPC server.
The invocation of this method consumes all registered handlers.