[][src]Struct ul::jsc::JSContextGroup

pub struct JSContextGroup {
    pub raw: JSContextGroupRef,
}

A group that associates JavaScript contexts with one another.

Contexts in the same group may share and exchange JavaScript objects. Sharing and/or exchanging JavaScript objects between contexts in different groups will produce undefined behavior. When objects from the same context group are used in multiple threads, explicit synchronization is required.

Fields

raw: JSContextGroupRef

Methods

impl JSContextGroup[src]

pub fn new() -> Self[src]

Creates a JavaScript context group.

pub fn new_context(&self) -> JSContext[src]

Creates a global JavaScript execution context in this context group.

This allocates a global object and populates it with all the built-in JavaScript objects, such as Object, Function, String, and Array.

The created global context retains this group.

pub fn new_context_with_class(&self, global_object_class: &JSClass) -> JSContext[src]

Creates a global JavaScript execution context in this context group.

This allocates a global object and populates it with all the built-in JavaScript objects, such as Object, Function, String, and Array.

The created global context retains this group.

  • global_object_class: The class to use when creating the global object.

Trait Implementations

impl Default for JSContextGroup[src]

fn default() -> Self[src]

Creates a JavaScript context group.

impl Drop for JSContextGroup[src]

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.