Struct rquickjs_core::Ctx [−][src]
Context in use, passed to Context::with
.
Implementations
impl<'js> Ctx<'js>
[src]
pub fn eval<V: FromJs<'js>, S: Into<Vec<u8>>>(self, source: S) -> Result<V>
[src]
Evaluate a script in global context
pub fn eval_file<V: FromJs<'js>, P: AsRef<Path>>(self, path: P) -> Result<V>
[src]
Evaluate a script directly from a file.
pub fn compile<N, S>(self, name: N, source: S) -> Result<Module<'js>> where
N: Into<Vec<u8>>,
S: Into<Vec<u8>>,
[src]
N: Into<Vec<u8>>,
S: Into<Vec<u8>>,
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>)>
[src]
Creates promise and resolving functions.
pub fn spawn<F, T>(&self, future: F) where
F: Future<Output = T> + ParallelSend + 'static,
T: ParallelSend + 'static,
[src]
F: Future<Output = T> + ParallelSend + 'static,
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> 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>,