pub struct Engine<E: ScriptEngine> { /* private fields */ }Expand description
Statically dispatched owner of a script backend.
Backend-specific operations are available through the explicit backend accessors.
Implementations§
Source§impl<E: ScriptEngine> Engine<E>
impl<E: ScriptEngine> Engine<E>
pub fn new(backend: E) -> Self
pub fn backend(&self) -> &E
pub fn backend_mut(&mut self) -> &mut E
pub fn eval(&mut self, code: &str, description: &str)
pub fn eval_at(&mut self, code: &str, url: Option<&Url>, description: &str)
pub fn eval_internal(&mut self, code: &str, description: &str)
pub fn eval_module(&mut self, code: &str, url: Option<&Url>, description: &str)
pub fn eval_json( &mut self, code: &str, description: &str, ) -> Result<Value, String>
pub fn set_import_map(&self, json: &str, base_url: Option<&Url>)
pub fn poll_module_evaluations(&mut self)
pub fn has_pending_module_evaluations(&self) -> bool
pub fn has_pending_module_loads(&self) -> bool
pub fn begin_job_slice(&self) -> E::JobScope
pub fn job_budget(&self) -> Duration
pub fn set_job_budget(&self, duration: Duration)
pub fn pending_task_count(&self) -> u64
pub fn job_slice_exhausted(&self) -> bool
pub fn jobs_remain(&self) -> bool
pub fn run_jobs(&mut self, description: &str)
pub fn run_jobs_with_progress(&mut self, description: &str) -> bool
pub fn next_timer_deadline(&self) -> Option<Instant>
pub fn run_due_timers(&mut self, profiling: bool) -> bool
pub fn dispatch_dom_event( &mut self, chain: &[NodeId], event: &DomEvent, event_state: &mut EventState, profiling: bool, ) -> bool
pub fn dispatch_document_event(&mut self, name: &str) -> bool
pub fn dispatch_node_event(&mut self, node_id: NodeId, name: &str) -> bool
pub fn dispatch_window_event(&mut self, name: &str) -> bool
pub fn set_document_ready_state(&mut self, next: &'static str) -> bool
pub fn sweep_detached_nodes(&mut self)
pub fn poll_host_updates(&mut self) -> bool
pub fn console_entries_after(&self, sequence: u64) -> Vec<DiagnosticEntry>
pub fn runtime_errors_after(&self, sequence: u64) -> Vec<DiagnosticEntry>
pub fn diagnostic_batch( &self, console_after: u64, errors_after: u64, limit: usize, ) -> DiagnosticBatch
Auto Trait Implementations§
impl<E> Forget for Engine<E>
impl<E> Freeze for Engine<E>where
E: Freeze,
impl<E> Move for Engine<E>
impl<E> RefUnwindSafe for Engine<E>where
E: RefUnwindSafe,
impl<E> Send for Engine<E>where
E: Send,
impl<E> Sync for Engine<E>where
E: Sync,
impl<E> Unpin for Engine<E>where
E: Unpin,
impl<E> UnsafeUnpin for Engine<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for Engine<E>where
E: UnwindSafe,
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
Mutably borrows from an owned value. Read more
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert