toolkit/grpc_registration.rs
1//! gRPC registration data shared by gear capabilities and the runtime.
2
3/// Represents a gRPC service registration callback used by the gRPC hub.
4///
5/// Each gear that exposes gRPC services provides one or more of these.
6/// The `register` closure adds the service into the provided `RoutesBuilder`.
7#[cfg(feature = "otel")]
8pub struct RegisterGrpcServiceFn {
9 pub service_name: &'static str,
10 pub register: Box<dyn Fn(&mut tonic::service::RoutesBuilder) + Send + Sync>,
11}
12
13#[cfg(not(feature = "otel"))]
14pub struct RegisterGrpcServiceFn {
15 pub service_name: &'static str,
16}