[][src]Struct rusty_v8::OwnedIsolate

pub struct OwnedIsolate(_);

Same as Isolate but gets disposed when it goes out of scope.

Methods from Deref<Target = Isolate>

pub fn thread_safe_handle(&mut self) -> IsolateHandle[src]

pub unsafe fn set_data(&mut self, slot: u32, ptr: *mut c_void)[src]

Associate embedder-specific data with the isolate. |slot| has to be between 0 and GetNumberOfDataSlots() - 1.

pub fn get_data(&self, slot: u32) -> *mut c_void[src]

Retrieve embedder-specific data from the isolate. Returns NULL if SetData has never been called for the given |slot|.

pub fn get_number_of_data_slots(&self) -> u32[src]

Returns the maximum number of available embedder data slots. Valid slots are in the range of 0 - GetNumberOfDataSlots() - 1.

pub fn get_current_context<'sc>(&mut self) -> Local<'sc, Context>[src]

Returns the context of the currently running JavaScript, or the context on the top of the stack if no JavaScript is running.

pub fn get_entered_or_microtask_context<'sc>(&mut self) -> Local<'sc, Context>[src]

Returns either the last context entered through V8's C++ API, or the context of the currently running microtask while processing microtasks. If a context is entered while executing a microtask, that context is returned.

pub fn set_capture_stack_trace_for_uncaught_exceptions(
    &mut self,
    capture: bool,
    frame_limit: i32
)
[src]

Tells V8 to capture current stack trace when uncaught exception occurs and report it to the message listeners. The option is off by default.

pub fn add_message_listener(&mut self, callback: MessageCallback) -> bool[src]

Adds a message listener (errors only).

The same message listener can be added more than once and in that case it will be called more than once for each message.

The exception object will be passed to the callback.

pub fn set_promise_reject_callback(&mut self, callback: PromiseRejectCallback)[src]

Set callback to notify about promise reject with no handler, or revocation of such a previous notification once the handler is added.

pub fn set_host_initialize_import_meta_object_callback(
    &mut self,
    callback: HostInitializeImportMetaObjectCallback
)
[src]

This specifies the callback called by the upcoming importa.meta language feature to retrieve host-defined meta data for a module.

pub fn set_host_import_module_dynamically_callback(
    &mut self,
    callback: HostImportModuleDynamicallyCallback
)
[src]

This specifies the callback called by the upcoming dynamic import() language feature to load modules.

pub fn throw_exception<'sc>(
    &mut self,
    exception: Local<Value>
) -> Local<'sc, Value>
[src]

Schedules an exception to be thrown when returning to JavaScript. When an exception has been scheduled it is illegal to invoke any JavaScript operation; the caller must return immediately and only after the exception has been handled does it become legal to invoke JavaScript operations.

pub fn run_microtasks(&mut self)[src]

Runs the default MicrotaskQueue until it gets empty. Any exceptions thrown by microtask callbacks are swallowed.

pub fn enqueue_microtask(&mut self, microtask: Local<Function>)[src]

Enqueues the callback to the default MicrotaskQueue

Trait Implementations

impl Deref for OwnedIsolate[src]

type Target = Isolate

The resulting type after dereferencing.

impl DerefMut for OwnedIsolate[src]

impl Drop for OwnedIsolate[src]

impl InIsolate for OwnedIsolate[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.