use sensorml::model::SensorMLDocument;
pub trait InitiativeMapper {
fn map_to_sensorml(
&self,
input: &serde_json::Value,
context: &dyn ContextProvider,
) -> Result<SensorMLDocument, MappingError>;
}
pub trait ContextProvider {
fn get_station_profile(&self, id: &str) -> Result<StationProfile, ContextError>;
}
#[derive(Debug)]
pub struct MappingError {
pub message: String,
}
#[derive(Debug)]
pub enum ContextError {
NotFound,
InvalidFormat,
}
#[derive(Debug)]
pub struct StationProfile {
pub id: String,
}