Struct v8::isolate::Isolate
[−]
[src]
pub struct Isolate(_);
Isolate represents an isolated instance of the V8 engine.
V8 isolates have completely separate states. Objects from one isolate must not be used in other isolates. The embedder can create multiple isolates and use them in parallel in multiple threads. An isolate can be entered by at most one thread at any given time. The Locker/Unlocker API must be used to synchronize.
Methods
impl Isolate
[src]
fn new() -> Isolate
Creates a new isolate.
fn builder() -> Builder
Creates a new isolate builder.
unsafe fn from_raw(raw: IsolatePtr) -> Isolate
Creates a data from a set of raw pointers.
This isolate must at some point have been created by Isolate::new
, since this library
expects isolates to be configured a certain way and contain embedder information.
fn as_raw(&self) -> IsolatePtr
Returns the underlying raw pointer behind this isolate.
fn current_context(&self) -> Option<Context>
Returns the context bound to the current thread for this isolate.
A context will be bound by for example Context::make_current
, or while inside of a
function callback.
fn run_enqueued_tasks(&self)
Runs all enqueued tasks until there are no more tasks available.
fn run_enqueued_task(&self) -> bool
Runs a single enqueued task, if there is one. Returns true
if a task was executed, and
false
if there are no pending tasks to run.
fn run_idle_tasks(&self, deadline: Duration)
Runs as many idle tasks as possible within the specified deadline. It is not guaranteed that the execution of the tasks will take less time than the specified deadline.
fn run_idle_task(&self, deadline: Duration) -> bool
Runs a single idle task within the specified deadline. It is not guaranteed that the
execution of the task will take less time than the specified deadline. Returns true
if a
task was executed, and false
if there are no pending tasks to run.
fn enqueue_task(&self, task: Task)
Enqueues the specified task to run as soon as possible.
fn enqueue_delayed_task(&self, delay: Duration, task: Task)
Enqueues the specified task to run after the specified delay has passed.
fn enqueue_idle_task(&self, idle_task: IdleTask)
Enqueues a task to be run when the isolate is considered to be "idle."
fn supports_idle_tasks(&self) -> bool
Whether this isolate was configured to support idle tasks.
Trait Implementations
impl Debug for Isolate
[src]
impl Clone for Isolate
[src]
fn clone(&self) -> Isolate
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more