spacetimedb_sats/
map_type.rsuse crate::{meta_type::MetaType, AlgebraicType, SpacetimeType};
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, SpacetimeType)]
#[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)])
}
}