hyperlane_plugin_grpc/trait.rs
1use super::*;
2
3/// Pluggable interceptor invoked before each gRPC unary service dispatch.
4pub trait GrpcInterceptor: Send + Sync + 'static {
5 /// Inspects or rejects an incoming gRPC call before the service handler runs.
6 ///
7 /// # Arguments
8 ///
9 /// - `&str` - Full gRPC method path (`/package.Service/Method`).
10 ///
11 /// # Returns
12 ///
13 /// - `Result<(), GrpcError>` - `Ok(())` to continue dispatch, or `Err(GrpcError)` to short-circuit.
14 fn before_call(&self, path: &str) -> Result<(), GrpcError>;
15}