use crate::Module;
pub struct Library {
pub modules: Vec<(String, Module)>,
}
impl Library {
pub fn builder() -> LibraryBuilder {
LibraryBuilder { modules: vec![] }
}
}
pub struct LibraryBuilder {
modules: Vec<(String, Module)>,
}
impl LibraryBuilder {
pub fn build(self) -> Library {
Library {
modules: self.modules,
}
}
pub fn module(mut self, identifier: &str, module: Module) -> Self {
self.modules.push((identifier.to_string(), module));
self
}
}