pub trait GrpcHubCapability: Send + Sync {
// Required method
fn bound_endpoint(&self) -> Option<String>;
// Provided method
fn serves_no_endpoint(&self) -> bool { ... }
}Expand description
gRPC Hub capability: hosts the gRPC server.
This trait is implemented by the single gear responsible for hosting
the tonic::Server instance. Only one gear per process should implement this.
Required Methods§
Sourcefn bound_endpoint(&self) -> Option<String>
fn bound_endpoint(&self) -> Option<String>
Returns the bound endpoint after the server starts listening.
Examples:
- TCP:
http://127.0.0.1:50652 - Unix socket:
unix:///path/to/socket - Named pipe:
pipe://\\.\pipe\name
Returns None if the server hasn’t started listening yet.
Provided Methods§
Sourcefn serves_no_endpoint(&self) -> bool
fn serves_no_endpoint(&self) -> bool
Whether the hub has settled on binding nothing (listen_addr: none, or
no services to serve), so bound_endpoint
stays None for good.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".