pub trait LocalCapabilityHandler: Send + Sync {
// Required methods
fn descriptor(&self) -> CapabilityDescriptor;
fn handle(
&self,
request: &CapabilityRequest,
) -> CapabilityResult<CapabilityResponse>;
// Provided method
fn is_healthy(&self) -> bool { ... }
}Expand description
Application-provided implementation of a capability hosted in this process.
Required Methods§
Sourcefn descriptor(&self) -> CapabilityDescriptor
fn descriptor(&self) -> CapabilityDescriptor
Describes the capability exposed by this handler.
Sourcefn handle(
&self,
request: &CapabilityRequest,
) -> CapabilityResult<CapabilityResponse>
fn handle( &self, request: &CapabilityRequest, ) -> CapabilityResult<CapabilityResponse>
Handles one validated capability request.
Provided Methods§
Sourcefn is_healthy(&self) -> bool
fn is_healthy(&self) -> bool
Reports whether this handler may currently receive traffic.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".