use std::collections::HashMap;
use std::time::Duration;
use bigdecimal::BigDecimal;
use chrono::{DateTime, NaiveDate, NaiveDateTime, NaiveTime, Utc};
use qubit_value::Value;
use url::Url;
pub trait IntoMetadataValue {
fn into_metadata_value(self) -> Value;
}
macro_rules! impl_into_metadata_value {
($($type:ty),+ $(,)?) => {
$(
impl IntoMetadataValue for $type {
#[inline]
fn into_metadata_value(self) -> Value {
Value::new(self)
}
}
)+
};
}
impl_into_metadata_value!(
bool,
char,
i8,
i16,
i32,
i64,
i128,
u8,
u16,
u32,
u64,
u128,
f32,
f64,
String,
&str,
NaiveDate,
NaiveTime,
NaiveDateTime,
DateTime<Utc>,
num_bigint::BigInt,
BigDecimal,
isize,
usize,
Duration,
Url,
HashMap<String, String>,
serde_json::Value,
);