use crate::domain::{HardwareReport, PublishConfig, PublishError, ReportConfig, ReportError};
use async_trait::async_trait;
#[async_trait]
pub trait HardwareReportingService: Send + Sync {
async fn generate_report(&self, config: ReportConfig) -> Result<HardwareReport, ReportError>;
async fn publish_report(
&self,
report: &HardwareReport,
config: &PublishConfig,
) -> Result<(), PublishError>;
async fn validate_dependencies(&self) -> Result<Vec<String>, ReportError>;
async fn check_privileges(&self) -> Result<bool, ReportError>;
}
#[async_trait]
pub trait HardwareMonitoringService: Send + Sync {
async fn start_monitoring(
&self,
interval_seconds: u64,
config: ReportConfig,
) -> Result<MonitoringHandle, ReportError>;
}
#[derive(Debug)]
pub struct MonitoringHandle {
pub session_id: String,
}
impl MonitoringHandle {
pub async fn stop(&self) -> Result<(), ReportError> {
Ok(())
}
}