Skip to main content

LocalCapabilityHandler

Trait LocalCapabilityHandler 

Source
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§

Source

fn descriptor(&self) -> CapabilityDescriptor

Describes the capability exposed by this handler.

Source

fn handle( &self, request: &CapabilityRequest, ) -> CapabilityResult<CapabilityResponse>

Handles one validated capability request.

Provided Methods§

Source

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".

Implementors§