pub struct Runtime { /* private fields */ }Expand description
A wrapper for the JSContext structure in SpiderMonkey.
Implementations§
Source§impl Runtime
impl Runtime
Sourcepub fn thread_safe_js_context(&self) -> ThreadSafeJSContext
pub fn thread_safe_js_context(&self) -> ThreadSafeJSContext
Create a ThreadSafeJSContext that can detect when this Runtime is destroyed.
Sourcepub fn new(engine: JSEngineHandle) -> Runtime
pub fn new(engine: JSEngineHandle) -> Runtime
Creates a new JSContext.
Sourcepub fn prepare_for_new_child(&self) -> ParentRuntime
pub fn prepare_for_new_child(&self) -> ParentRuntime
Signal that a new child runtime will be created in the future, and ensure
that this runtime will not allow itself to be destroyed before the new
child runtime. Returns a handle that can be passed to create_with_parent
in order to create a new runtime on another thread that is associated with
this runtime.
Sourcepub unsafe fn create_with_parent(parent: ParentRuntime) -> Runtime
pub unsafe fn create_with_parent(parent: ParentRuntime) -> Runtime
Creates a new JSContext with a parent runtime. If the parent does not outlive
the new runtime, its destructor will assert.
Unsafety: If panicking does not abort the program, any threads with child runtimes will continue executing after the thread with the parent runtime panics, but they will be in an invalid and undefined state.
pub fn evaluate_script( &self, glob: HandleObject<'_>, script: &str, rval: MutableHandleValue<'_>, options: CompileOptionsWrapper, ) -> Result<(), ()>
pub fn new_compile_options( &self, filename: &str, line: u32, ) -> CompileOptionsWrapper
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Runtime
impl RefUnwindSafe for Runtime
impl !Send for Runtime
impl !Sync for Runtime
impl Unpin for Runtime
impl UnwindSafe for Runtime
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
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 40 bytes