csdif-core 0.1.2

Core library for modeling, validating, and transforming CSDIF data
Documentation
// csdif_core/src/mapper.rs
// SPDX-License-Identifier: MIT

use sensorml::model::document::SensorMLDocument;
use crate::error::ContextError;
use crate::error::MappingError;

pub trait InitiativeForwardMapper {
    fn map_to_sensorml(
        &self,
        input: &serde_json::Value,
        context: &dyn ContextProvider,
    ) -> Result<SensorMLDocument, MappingError>;
}

/// Provides context for mapping, such as station metadata.
pub trait ContextProvider {
    fn get_station_profile(&self, id: &str) -> Result<StationProfile, ContextError>;
}

#[derive(Debug)]
pub struct StationProfile {
    pub id: String,
}