Skip to main content

ServiceProvider

Trait ServiceProvider 

Source
pub trait ServiceProvider: Send + Sync {
    // Required methods
    fn kind(&self) -> ServiceKind;
    fn detect(&self, probe_output: &ProbeOutput) -> bool;

    // Provided method
    fn quick_metrics(&self, _probe_output: &ProbeOutput) -> Vec<ServiceMetric> { ... }
}
Expand description

Trait for service-specific detection from probe output.

Each provider implements:

  1. Quick detection from probe output
  2. Basic metric extraction from Quick Scan output

Required Methods§

Source

fn kind(&self) -> ServiceKind

Returns the service type this provider handles.

Source

fn detect(&self, probe_output: &ProbeOutput) -> bool

Quick check: is this service present on the server?

Called during Quick Scan with the parsed probe output. Should be fast — only check for presence, not detailed metrics.

Provided Methods§

Source

fn quick_metrics(&self, _probe_output: &ProbeOutput) -> Vec<ServiceMetric>

Extract basic metrics from Quick Scan probe output.

This is called immediately during Quick Scan to provide basic service information. Default implementation returns empty metrics.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§