23 lines
564 B
Rust
23 lines
564 B
Rust
use crate::types::script_type_namespace::ScriptTypeNamespace;
|
|
use std::borrow::{Borrow, BorrowMut};
|
|
|
|
pub struct TypeLibrary {
|
|
script_types: Box<ScriptTypeNamespace>,
|
|
}
|
|
|
|
impl TypeLibrary {
|
|
pub fn new() -> TypeLibrary {
|
|
TypeLibrary {
|
|
script_types: Box::new(ScriptTypeNamespace::new(None)),
|
|
}
|
|
}
|
|
|
|
pub fn get_global_namespace(&self) -> &ScriptTypeNamespace {
|
|
self.script_types.borrow()
|
|
}
|
|
|
|
pub fn get_global_namespace_mut(&mut self) -> &mut ScriptTypeNamespace {
|
|
self.script_types.borrow_mut()
|
|
}
|
|
}
|