use crate::{de::Deserialize, meta_type::MetaType, ser::Serialize, AlgebraicType};
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
#[sats(crate = crate)]
pub struct MapType {
pub key_ty: AlgebraicType,
pub ty: AlgebraicType,
}
impl MapType {
pub fn new(key: AlgebraicType, value: AlgebraicType) -> Self {
Self { key_ty: key, ty: value }
}
}
impl MetaType for MapType {
fn meta_type() -> AlgebraicType {
AlgebraicType::product([("key_ty", AlgebraicType::ZERO_REF), ("ty", AlgebraicType::ZERO_REF)])
}
}