Struct quickjs_runtime::quickjsruntime::QuickJsRuntime[][src]

pub struct QuickJsRuntime { /* fields omitted */ }

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]

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]

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]

pub fn gc(&self)[src]

run the garbage collector

pub fn do_with<C, R>(task: C) -> R where
    C: FnOnce(&QuickJsRuntime) -> R, 
[src]

pub fn do_with_mut<C, R>(task: C) -> R where
    C: FnOnce(&mut QuickJsRuntime) -> R, 
[src]

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]

this method tries to load a module script using the runtimes script_module loaders

Trait Implementations

impl Drop for QuickJsRuntime[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,