Struct rquickjs_core::Context [−][src]
A single execution context with its own global variables and stack.
Can share objects with other contexts of the same runtime.
Implementations
impl Context
[src]
pub fn from_ctx<'js>(ctx: Ctx<'js>) -> Result<Self>
[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::custom
,
Context::builder
or Context::full
.
pub fn custom<I: Intrinsic>(runtime: &Runtime) -> Result<Self>
[src]
Creates a context with only the required intrinsics registered.
If additional functions are required use Context::custom
,
Context::builder
or Context::full
.
pub fn full(runtime: &Runtime) -> Result<Self>
[src]
Creates a context with all standart available intrinsics registered.
If precise controll is required of which functions are available use
Context::custom
or Context::builder
.
pub fn builder() -> ContextBuilder<()>
[src]
Create a context builder for creating a context with a specific set of intrinsics
pub fn enable_big_num_ext(&self, enable: bool)
[src]
pub fn runtime(&self) -> &Runtime
[src]
Returns the associated runtime
pub fn with<F, R>(&self, f: F) -> R where
F: FnOnce(Ctx<'_>) -> R,
[src]
F: FnOnce(Ctx<'_>) -> R,
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
Auto Trait Implementations
impl !RefUnwindSafe for Context
[src]
impl !Send for Context
[src]
impl !Sync for Context
[src]
impl Unpin for Context
[src]
impl !UnwindSafe for Context
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,