[][src]Struct rusty_v8::IsolateHandle

pub struct IsolateHandle(_);

IsolateHandle is a thread-safe reference to an Isolate. It's main use is to terminate execution of a running isolate from another thread.

It is created with Isolate::thread_safe_handle().

IsolateHandle is Cloneable, Send, and Sync.

Implementations

impl IsolateHandle[src]

pub fn terminate_execution(&self) -> bool[src]

Forcefully terminate the current thread of JavaScript execution in the given isolate.

This method can be used by any thread even if that thread has not acquired the V8 lock with a Locker object.

Returns false if Isolate was already destroyed.

pub fn cancel_terminate_execution(&self) -> bool[src]

Resume execution capability in the given isolate, whose execution was previously forcefully terminated using TerminateExecution().

When execution is forcefully terminated using TerminateExecution(), the isolate can not resume execution until all JavaScript frames have propagated the uncatchable exception which is generated. This method allows the program embedding the engine to handle the termination event and resume execution capability, even if JavaScript frames remain on the stack.

This method can be used by any thread even if that thread has not acquired the V8 lock with a Locker object.

Returns false if Isolate was already destroyed.

pub fn is_execution_terminating(&self) -> bool[src]

Is V8 terminating JavaScript execution.

Returns true if JavaScript execution is currently terminating because of a call to TerminateExecution. In that case there are still JavaScript frames on the stack and the termination exception is still active.

Returns false if Isolate was already destroyed.

pub fn request_interrupt(
    &self,
    callback: extern "C" fn(isolate: &mut Isolate, data: *mut c_void),
    data: *mut c_void
) -> bool
[src]

Request V8 to interrupt long running JavaScript code and invoke the given |callback| passing the given |data| to it. After |callback| returns control will be returned to the JavaScript code. There may be a number of interrupt requests in flight. Can be called from another thread without acquiring a |Locker|. Registered |callback| must not reenter interrupted Isolate.

Returns false if Isolate was already destroyed.

Trait Implementations

impl Clone for IsolateHandle[src]

impl Send for IsolateHandle[src]

impl Sync for IsolateHandle[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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.