use std::sync::Arc;
use imbl::Vector;
use serde::{Deserialize, Serialize};
use crate::{model::Graph, runtime::{instruction::{Instruction, Instructions}, proc::ProcEnv, Error}};
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct Block {
pub ins: Vector<Arc<dyn Instruction>>,
}
#[typetag::serde(name = "Block")]
impl Instruction for Block {
fn exec(&self, _env: &mut ProcEnv, _graph: &mut Graph) -> Result<Option<Instructions>, Error> {
let mut instructions = Instructions::default();
instructions.append(&self.ins);
Ok(Some(instructions))
}
}