pub struct ServiceModuleDefinition<Context> { /* private fields */ }Expand description
It stores all procedures defined for a RPC service
Implementations§
source§impl<Context> ServiceModuleDefinition<Context>
impl<Context> ServiceModuleDefinition<Context>
pub fn new() -> Self
sourcepub fn add_unary<H: Fn(CommonPayload, Arc<Context>) -> UnaryResponse + Send + Sync + 'static>(
&mut self,
name: &str,
handler: H
)
pub fn add_unary<H: Fn(CommonPayload, Arc<Context>) -> UnaryResponse + Send + Sync + 'static>( &mut self, name: &str, handler: H )
Add an unary procedure handler to the service definition
sourcepub fn add_server_streams<H: Fn(CommonPayload, Arc<Context>) -> ServerStreamsResponse + Send + Sync + 'static>(
&mut self,
name: &str,
handler: H
)
pub fn add_server_streams<H: Fn(CommonPayload, Arc<Context>) -> ServerStreamsResponse + Send + Sync + 'static>( &mut self, name: &str, handler: H )
Add a server streams procedure handler to the service definition
sourcepub fn add_client_streams<H: Fn(ClientStreamsPayload, Arc<Context>) -> ClientStreamsResponse + Send + Sync + 'static>(
&mut self,
name: &str,
handler: H
)
pub fn add_client_streams<H: Fn(ClientStreamsPayload, Arc<Context>) -> ClientStreamsResponse + Send + Sync + 'static>( &mut self, name: &str, handler: H )
Add a client streams procedure handler to the service definition
sourcepub fn add_bidir_streams<H: Fn(BiStreamsPayload, Arc<Context>) -> BiStreamsResponse + Send + Sync + 'static>(
&mut self,
name: &str,
handler: H
)
pub fn add_bidir_streams<H: Fn(BiStreamsPayload, Arc<Context>) -> BiStreamsResponse + Send + Sync + 'static>( &mut self, name: &str, handler: H )
Add a bidirectional streams procedure handler to the service definition