Skip to main content

RpcService

Trait RpcService 

Source
pub trait RpcService: Send + 'static {
    // Required methods
    fn handle_request(&self, request: &[u8]) -> Result<Vec<u8>>;
    fn name(&self) -> &str;
}
Expand description

Trait for RPC service implementations.

This is the core service trait that handles incoming requests. Implementations should parse the request, dispatch to handlers, and build responses.

Required Methods§

Source

fn handle_request(&self, request: &[u8]) -> Result<Vec<u8>>

Handle an incoming request and return a response.

The request and response are Cap’n Proto serialized bytes.

Source

fn name(&self) -> &str

Get the service name for logging/debugging.

Implementors§