#![cfg_attr(not(feature = "std"), no_std)]
#![warn(missing_docs)]
#[cfg(feature = "std")]
extern crate std;
pub mod datacite;
pub mod dcat;
pub mod error;
pub mod extract;
pub mod fgdc;
pub mod inspire;
pub mod iso19115;
pub mod transform;
pub mod validate;
pub use error::{MetadataError, Result};
pub mod common {
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ContactInfo {
pub individual_name: Option<String>,
pub organization_name: Option<String>,
pub position_name: Option<String>,
pub email: Option<String>,
pub phone: Option<String>,
pub address: Option<Address>,
pub online_resource: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Address {
pub delivery_point: Option<String>,
pub city: Option<String>,
pub administrative_area: Option<String>,
pub postal_code: Option<String>,
pub country: Option<String>,
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
pub struct BoundingBox {
pub west: f64,
pub east: f64,
pub south: f64,
pub north: f64,
}
impl BoundingBox {
pub fn new(west: f64, east: f64, south: f64, north: f64) -> Self {
Self {
west,
east,
south,
north,
}
}
pub fn is_valid(&self) -> bool {
self.west <= self.east
&& self.south <= self.north
&& self.west >= -180.0
&& self.east <= 180.0
&& self.south >= -90.0
&& self.north <= 90.0
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Keyword {
pub keyword: String,
pub thesaurus: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TemporalExtent {
pub start: Option<chrono::DateTime<chrono::Utc>>,
pub end: Option<chrono::DateTime<chrono::Utc>>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct License {
pub name: String,
pub url: Option<String>,
}
}