pub struct QuickJsRuntimeAdapter { /* private fields */ }Implementations§
source§impl QuickJsRuntimeAdapter
impl QuickJsRuntimeAdapter
sourcepub fn memory_usage(&self) -> MemoryUsage
pub fn memory_usage(&self) -> MemoryUsage
get memory usage for this runtime
pub fn add_context_init_hook<H>(&self, hook: H) -> Result<(), JsError>where H: Fn(&QuickJsRuntimeAdapter, &QuickJsRealmAdapter) -> Result<(), JsError> + 'static,
pub fn create_context(id: &str) -> Result<(), JsError>
pub fn remove_context(id: &str)
pub fn get_context(&self, id: &str) -> &QuickJsRealmAdapter
pub fn opt_context(&self, id: &str) -> Option<&QuickJsRealmAdapter>
pub fn has_context(&self, id: &str) -> bool
sourcepub unsafe fn get_quickjs_context(
&self,
context: *mut JSContext
) -> &QuickJsRealmAdapter
pub unsafe fn get_quickjs_context( &self, context: *mut JSContext ) -> &QuickJsRealmAdapter
Safety
When passing a context pointer please make sure the corresponding QuickJsContext is still valid
pub fn get_rti_ref(&self) -> Option<Arc<QuickjsRuntimeFacadeInner>>
pub fn set_interrupt_handler<I: Fn(&QuickJsRuntimeAdapter) -> bool + 'static>( &mut self, interrupt_handler: I ) -> &mut Self
pub fn add_script_module_loader(&mut self, sml: ScriptModuleLoaderAdapter)
pub fn add_compiled_module_loader(&mut self, cml: CompiledModuleLoaderAdapter)
pub fn add_native_module_loader(&mut self, nml: NativeModuleLoaderAdapter)
pub fn get_main_realm(&self) -> &QuickJsRealmAdapter
pub fn with_all_module_loaders<C, R>(&self, consumer: C) -> Option<R>where C: Fn(&dyn ModuleLoader) -> Option<R>,
pub fn do_with<C, R>(task: C) -> Rwhere C: FnOnce(&QuickJsRuntimeAdapter) -> R,
pub fn do_with_mut<C, R>(task: C) -> Rwhere C: FnOnce(&mut QuickJsRuntimeAdapter) -> R,
sourcepub fn run_pending_jobs_if_any(&self)
pub fn run_pending_jobs_if_any(&self)
run pending jobs if avail
todo
move this to a quickjs_utils::pending_jobs so it can be used without doing QuickjsRuntime.do_with()
pub fn has_pending_jobs(&self) -> bool
pub fn run_pending_job(&self) -> Result<(), JsError>
pub fn get_id(&self) -> &str
source§impl QuickJsRuntimeAdapter
impl QuickJsRuntimeAdapter
pub fn load_module_script(&self, ref_path: &str, path: &str) -> Option<Script>
pub fn js_create_realm( &self, _id: &str ) -> Result<&QuickJsRealmAdapter, JsError>
pub fn remove_realm(&self, _id: &str)
pub fn get_realm(&self, id: &str) -> Option<&QuickJsRealmAdapter>
pub fn add_realm_init_hook<H>(&self, hook: H) -> Result<(), JsError>where H: Fn(&Self, &QuickJsRealmAdapter) -> Result<(), JsError> + 'static,
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for QuickJsRuntimeAdapter
impl !Send for QuickJsRuntimeAdapter
impl !Sync for QuickJsRuntimeAdapter
impl Unpin for QuickJsRuntimeAdapter
impl !UnwindSafe for QuickJsRuntimeAdapter
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