use crate::instruction::Instruction; use std::rc::Rc; pub struct Function { name: Rc, instructions: Vec, register_count: usize, } impl Function { pub fn new(name: &str, instructions: Vec, register_count: usize) -> Self { Self { name: name.into(), instructions, register_count, } } pub fn name(&self) -> &str { &self.name } pub fn name_owned(&self) -> Rc { self.name.clone() } pub fn instructions(&self) -> &Vec { &self.instructions } pub fn register_count(&self) -> usize { self.register_count } }