Struct quick_js::ContextBuilder 
source · pub struct ContextBuilder { /* private fields */ }Expand description
A builder for Context.
Create with Context::builder.
Implementations§
source§impl ContextBuilder
 
impl ContextBuilder
sourcepub fn memory_limit(self, max_bytes: usize) -> Self
 
pub fn memory_limit(self, max_bytes: usize) -> Self
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))
sourcepub fn console<B>(self, backend: B) -> Selfwhere
    B: ConsoleBackend,
 
pub fn console<B>(self, backend: B) -> Selfwhere
    B: ConsoleBackend,
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:
sourcepub fn build(self) -> Result<Context, ContextError>
 
pub fn build(self) -> Result<Context, ContextError>
Finalize the builder and build a JS Context.