pub trait ServerReflectionExt: ServerReflection {
// Required method
fn register(self: Arc<Self>, router: Router) -> Router;
}Expand description
Generated v1 service trait and registration extension, for callers that mount a single protocol version by hand:
use std::sync::Arc;
use connectrpc::Router;
use connectrpc_reflection::{Reflector, ReflectionService, ServerReflectionExt};
let reflector = Reflector::from_descriptor_set_bytes(descriptor_set_bytes()).unwrap();
let service = Arc::new(ReflectionService::new(reflector));
let router = service.register(Router::new()); // v1 onlyExtension trait for registering a service implementation with a Router.
This trait is automatically implemented for all types that implement the service trait.
§Example
ⓘ
use std::sync::Arc;
let service = Arc::new(MyServiceImpl);
let router = service.register(Router::new());Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".