csdif_core/
forward_mapper.rs

1// csdif_core/src/mapper.rs
2// SPDX-License-Identifier: MIT
3
4use sensorml::model::document::SensorMLDocument;
5use crate::error::ContextError;
6use crate::error::MappingError;
7
8pub trait InitiativeForwardMapper {
9    fn map_to_sensorml(
10        &self,
11        input: &serde_json::Value,
12        context: &dyn ContextProvider,
13    ) -> Result<SensorMLDocument, MappingError>;
14}
15
16/// Provides context for mapping, such as station metadata.
17pub trait ContextProvider {
18    fn get_station_profile(&self, id: &str) -> Result<StationProfile, ContextError>;
19}
20
21#[derive(Debug)]
22pub struct StationProfile {
23    pub id: String,
24}
25