[][src]Struct rquickjs::Context

pub struct Context { /* fields omitted */ }

A single execution context with its own global variables and stack.

Can share objects with other contexts of the same runtime.

Methods

impl Context[src]

pub fn base(runtime: &Runtime) -> Result<Self>[src]

Creates a base context with only the required functions registered. If additional functions are required use Context::build or Contex::full.

pub fn full(runtime: &Runtime) -> Result<Self>[src]

Creates a context with all standart available functions registered. If precise controll is required of wich functions are availble use Context::build

pub fn build(rt: &Runtime) -> ContextBuilder[src]

Create a context builder for creating a context with a specific set of intrinsics

pub fn set_max_stack_size(&self, size: usize)[src]

Set the maximum stack size for the local context stack

pub fn enable_big_num_ext(&self, enable: bool)[src]

pub fn with<F, R>(&self, f: F) -> R where
    F: FnOnce(Ctx) -> R, 
[src]

A entry point for manipulating and using javascript objects and scripts. The api is structured this way to avoid repeated locking the runtime when ever any function is called. This way the runtime is locked once before executing the callback. Furthermore, this way it is impossible to use values from different runtimes in this context which would otherwise be undefined behaviour.

This is the only way to get a Ctx object.

Trait Implementations

impl Drop for Context[src]

Auto Trait Implementations

impl !RefUnwindSafe for Context

impl !Send for Context

impl !Sync for Context

impl Unpin for Context

impl !UnwindSafe for Context

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.