Struct rustyscript::ModuleWrapper
source · pub struct ModuleWrapper { /* private fields */ }
Expand description
A wrapper type representing a runtime instance loaded with a single module
Implementations§
source§impl ModuleWrapper
impl ModuleWrapper
sourcepub fn new_from_module(
module: &Module,
options: RuntimeOptions
) -> Result<Self, Error>
pub fn new_from_module( module: &Module, options: RuntimeOptions ) -> Result<Self, Error>
sourcepub fn new_from_file(path: &str, options: RuntimeOptions) -> Result<Self, Error>
pub fn new_from_file(path: &str, options: RuntimeOptions) -> Result<Self, Error>
sourcepub fn get_module_context(&self) -> &ModuleHandle
pub fn get_module_context(&self) -> &ModuleHandle
Returns a reference to the module context.
sourcepub fn get_runtime(&mut self) -> &mut Runtime
pub fn get_runtime(&mut self) -> &mut Runtime
Returns a mutable reference to the underlying runtime.
sourcepub fn is_callable(&mut self, name: &str) -> bool
pub fn is_callable(&mut self, name: &str) -> bool
sourcepub fn call<T>(&mut self, name: &str, args: &[Value]) -> Result<T, Error>where
T: DeserializeOwned,
pub fn call<T>(&mut self, name: &str, args: &[Value]) -> Result<T, Error>where T: DeserializeOwned,
sourcepub fn call_stored<T>(
&mut self,
function: &JsFunction<'_>,
args: &[Value]
) -> Result<T, Error>where
T: DeserializeOwned,
pub fn call_stored<T>( &mut self, function: &JsFunction<'_>, args: &[Value] ) -> Result<T, Error>where T: DeserializeOwned,
Auto Trait Implementations§
impl !RefUnwindSafe for ModuleWrapper
impl !Send for ModuleWrapper
impl !Sync for ModuleWrapper
impl Unpin for ModuleWrapper
impl !UnwindSafe for ModuleWrapper
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