Struct quickjs_runtime::quickjsruntime::QuickJsRuntime [−][src]
Implementations
impl QuickJsRuntime
[src]
pub fn add_context_init_hook<H>(&self, hook: H) -> Result<(), EsError> where
H: Fn(&QuickJsRuntime, &QuickJsContext) -> Result<(), EsError> + 'static,
[src]
H: Fn(&QuickJsRuntime, &QuickJsContext) -> Result<(), EsError> + 'static,
pub fn create_context(id: &str) -> Result<(), EsError>
[src]
pub fn remove_context(id: &str)
[src]
pub fn get_context(&self, id: &str) -> &QuickJsContext
[src]
pub fn opt_context(&self, id: &str) -> Option<&QuickJsContext>
[src]
pub fn has_context(&self, id: &str) -> bool
[src]
pub unsafe fn get_quickjs_context(
&self,
context: *mut JSContext
) -> &QuickJsContext
[src]
&self,
context: *mut JSContext
) -> &QuickJsContext
Safety
When passing a context pointer please make sure the corresponding QuickJsContext is still valid
pub fn get_rt_ref(&self) -> Option<Arc<EsRuntime>>
[src]
pub fn add_script_module_loader(&mut self, sml: ScriptModuleLoaderAdapter)
[src]
pub fn add_native_module_loader(&mut self, nml: NativeModuleLoaderAdapter)
[src]
pub fn get_main_context(&self) -> &QuickJsContext
[src]
pub fn with_all_module_loaders<C, R>(&self, consumer: C) -> Option<R> where
C: Fn(&dyn ModuleLoader) -> Option<R>,
[src]
C: Fn(&dyn ModuleLoader) -> Option<R>,
pub fn gc(&self)
[src]
run the garbage collector
pub fn do_with<C, R>(task: C) -> R where
C: FnOnce(&QuickJsRuntime) -> R,
[src]
C: FnOnce(&QuickJsRuntime) -> R,
pub fn do_with_mut<C, R>(task: C) -> R where
C: FnOnce(&mut QuickJsRuntime) -> R,
[src]
C: FnOnce(&mut QuickJsRuntime) -> R,
pub fn run_pending_jobs_if_any(&self)
[src]
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
[src]
pub fn run_pending_job(&self) -> Result<(), EsError>
[src]
pub fn get_id(&self) -> &str
[src]
pub fn load_module_script_opt(
&self,
ref_path: &str,
path: &str
) -> Option<EsScript>
[src]
&self,
ref_path: &str,
path: &str
) -> Option<EsScript>
this method tries to load a module script using the runtimes script_module loaders
Trait Implementations
impl Drop for QuickJsRuntime
[src]
Auto Trait Implementations
impl !RefUnwindSafe for QuickJsRuntime
impl !Send for QuickJsRuntime
impl !Sync for QuickJsRuntime
impl Unpin for QuickJsRuntime
impl !UnwindSafe for QuickJsRuntime
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,