Struct quick_js::ContextBuilder[][src]

pub struct ContextBuilder { /* fields omitted */ }

A builder for Context.

Create with Context::builder.

Implementations

impl ContextBuilder[src]

pub fn memory_limit(self, max_bytes: usize) -> Self[src]

Sets the memory limit of the Javascript runtime (in bytes).

If the limit is exceeded, methods like eval will return a Err(ExecutionError::Exception(JsValue::Null))

pub fn console<B>(self, backend: B) -> Self where
    B: ConsoleBackend
[src]

Set a console handler that will proxy console.{log,trace,debug,...} calls.

The given argument must implement the console::ConsoleBackend trait.

A very simple logger could look like this:

pub fn build(self) -> Result<Context, ContextError>[src]

Finalize the builder and build a JS Context.

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, 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.