Skip to main content

Engine

Struct Engine 

Source
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>

Source

pub fn new(backend: E) -> Self

Source

pub fn backend(&self) -> &E

Source

pub fn backend_mut(&mut self) -> &mut E

Source

pub fn eval(&mut self, code: &str, description: &str)

Source

pub fn eval_at(&mut self, code: &str, url: Option<&Url>, description: &str)

Source

pub fn eval_internal(&mut self, code: &str, description: &str)

Source

pub fn eval_module(&mut self, code: &str, url: Option<&Url>, description: &str)

Source

pub fn eval_json( &mut self, code: &str, description: &str, ) -> Result<Value, String>

Source

pub fn set_import_map(&self, json: &str, base_url: Option<&Url>)

Source

pub fn poll_module_evaluations(&mut self)

Source

pub fn has_pending_module_evaluations(&self) -> bool

Source

pub fn has_pending_module_loads(&self) -> bool

Source

pub fn begin_job_slice(&self) -> E::JobScope

Source

pub fn job_budget(&self) -> Duration

Source

pub fn set_job_budget(&self, duration: Duration)

Source

pub fn pending_task_count(&self) -> u64

Source

pub fn job_slice_exhausted(&self) -> bool

Source

pub fn jobs_remain(&self) -> bool

Source

pub fn run_jobs(&mut self, description: &str)

Source

pub fn run_jobs_with_progress(&mut self, description: &str) -> bool

Source

pub fn next_timer_deadline(&self) -> Option<Instant>

Source

pub fn run_due_timers(&mut self, profiling: bool) -> bool

Source

pub fn dispatch_dom_event( &mut self, chain: &[NodeId], event: &DomEvent, event_state: &mut EventState, profiling: bool, ) -> bool

Source

pub fn dispatch_document_event(&mut self, name: &str) -> bool

Source

pub fn dispatch_node_event(&mut self, node_id: NodeId, name: &str) -> bool

Source

pub fn dispatch_window_event(&mut self, name: &str) -> bool

Source

pub fn set_document_ready_state(&mut self, next: &'static str) -> bool

Source

pub fn sweep_detached_nodes(&mut self)

Source

pub fn poll_host_updates(&mut self) -> bool

Source

pub fn console_entries_after(&self, sequence: u64) -> Vec<DiagnosticEntry>

Source

pub fn runtime_errors_after(&self, sequence: u64) -> Vec<DiagnosticEntry>

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> MaybeBoxed<Box<T>> for T

Source§

fn maybe_boxed(self) -> Box<T>

Convert
Source§

impl<T> MaybeBoxed<T> for T

Source§

fn maybe_boxed(self) -> T

Convert
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.