pub struct NoopScriptEngine;Expand description
A no-op script engine for when no scripting is needed
Trait Implementations§
Source§impl ScriptEngine for NoopScriptEngine
impl ScriptEngine for NoopScriptEngine
Source§fn init(&mut self, _document: &mut BaseDocument)
fn init(&mut self, _document: &mut BaseDocument)
Initialize the engine with a document
Source§fn execute(
&mut self,
_code: &str,
language: ScriptLanguage,
_context: &ExecutionContext,
) -> Result<ScriptValue, ScriptError>
fn execute( &mut self, _code: &str, language: ScriptLanguage, _context: &ExecutionContext, ) -> Result<ScriptValue, ScriptError>
Execute code in the specified language
Source§fn handle_event(&mut self, _event: &DomEvent) -> EventHandled
fn handle_event(&mut self, _event: &DomEvent) -> EventHandled
Handle a DOM event (keyboard, mouse, etc.)
Returns whether the event was consumed
Source§fn tick(&mut self) -> Result<bool, ScriptError>
fn tick(&mut self) -> Result<bool, ScriptError>
Poll for async work - called by document poll()
Returns true if more work pending
Source§fn set_error_handler(&mut self, _callback: Option<ScriptErrorCallback>)
fn set_error_handler(&mut self, _callback: Option<ScriptErrorCallback>)
Register an error callback
Auto Trait Implementations§
impl Freeze for NoopScriptEngine
impl RefUnwindSafe for NoopScriptEngine
impl Send for NoopScriptEngine
impl Sync for NoopScriptEngine
impl Unpin for NoopScriptEngine
impl UnsafeUnpin for NoopScriptEngine
impl UnwindSafe for NoopScriptEngine
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