pub struct Environment {
pub variables: HashMap<String, Value>,
/* private fields */
}Fields§
§variables: HashMap<String, Value>Implementations§
Source§impl Environment
impl Environment
pub fn new() -> Self
pub fn declare_var(&mut self, name: &str, value: Value) -> Result<(), String>
pub fn get_var(&self, name: &str) -> Result<&Value, String>
pub fn has_var(&self, name: &str) -> bool
pub fn declare_function( &mut self, name: &str, func: Value, ) -> Result<(), String>
pub fn get_function(&self, name: &str) -> Result<&Value, String>
pub fn load_lua_script(&mut self, path: &str) -> Result<Arc<Lua>, String>
pub fn register_lua_function( &mut self, dar_name: &str, lua_func_name: &str, lua_state: Arc<Lua>, ) -> Result<(), String>
pub fn register_external_functions( &mut self, lib_path: &str, funcs: &[ExternalFunc], ) -> Result<(), String>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Environment
impl !RefUnwindSafe for Environment
impl !Send for Environment
impl !Sync for Environment
impl Unpin for Environment
impl UnsafeUnpin for Environment
impl !UnwindSafe for Environment
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more