use serde::{Deserialize, Serialize};
use crate::{context::Context, error::RuntimeError, identifier::Identifier};
use super::{AbstractNode, Evaluation, Type, TypeConstructor};
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord, Serialize, Deserialize)]
pub struct StructureDefinition {
name: Identifier,
fields: Vec<(Identifier, TypeConstructor)>,
}
impl StructureDefinition {
pub fn new(name: Identifier, fields: Vec<(Identifier, TypeConstructor)>) -> Self {
Self { name, fields }
}
}
impl AbstractNode for StructureDefinition {
fn evaluate(
self,
context: &mut Context,
_manage_memory: bool,
) -> Result