Struct rquickjs::Ctx [−][src]
Context in use, passed to Context::with
.
Implementations
impl<'js> Ctx<'js>
[src]
pub fn eval<V, S>(self, source: S) -> Result<V, Error> where
V: FromJs<'js>,
S: Into<Vec<u8, Global>>,
[src]
V: FromJs<'js>,
S: Into<Vec<u8, Global>>,
Evaluate a script in global context
pub fn eval_file<V, P>(self, path: P) -> Result<V, Error> where
P: AsRef<Path>,
V: FromJs<'js>,
[src]
P: AsRef<Path>,
V: FromJs<'js>,
Evaluate a script directly from a file.
pub fn compile<N, S>(
self,
name: N,
source: S
) -> Result<Module<'js, Evaluated>, Error> where
N: Into<Vec<u8, Global>>,
S: Into<Vec<u8, Global>>,
[src]
self,
name: N,
source: S
) -> Result<Module<'js, Evaluated>, Error> where
N: Into<Vec<u8, Global>>,
S: Into<Vec<u8, Global>>,
Compile a module for later use.
pub fn globals(self) -> Object<'js>
[src]
Returns the global object of this context.
pub fn promise(
self
) -> Result<(Object<'js>, Function<'js>, Function<'js>), Error>
[src]
self
) -> Result<(Object<'js>, Function<'js>, Function<'js>), Error>
Creates promise and resolving functions.
pub fn spawn<F, T>(&self, future: F) where
T: ParallelSend + 'static,
F: Future<Output = T> + ParallelSend + 'static,
[src]
T: ParallelSend + 'static,
F: Future<Output = T> + ParallelSend + 'static,
This is supported on crate feature
futures
only.Spawn future using configured async runtime
impl<'js> Ctx<'js>
[src]
pub fn register(self, v: Value<'js>) -> RegisteryKey
[src]
This is supported on crate feature
registery
only.Store a value in the registery so references to it can be kept outside the scope of context use.
A registered value can be retrieved from any context belonging to the same runtime.
pub fn deregister(self, k: RegisteryKey) -> Option<Value<'js>>
[src]
This is supported on crate feature
registery
only.Remove a value from the registery.
pub fn get_register(self, k: RegisteryKey) -> Option<Value<'js>>
[src]
This is supported on crate feature
registery
only.Get a value from the registery.
Trait Implementations
Auto Trait Implementations
impl<'js> !RefUnwindSafe for Ctx<'js>
[src]
impl<'js> !Send for Ctx<'js>
[src]
impl<'js> !Sync for Ctx<'js>
[src]
impl<'js> Unpin for Ctx<'js>
[src]
impl<'js> UnwindSafe for Ctx<'js>
[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> ParallelSend for T where
T: Send,
[src]
T: Send,
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>,