Struct quickjs_runtime::quickjscontext::QuickJsContext [−][src]
Fields
id: String
context: *mut JSContext
Implementations
impl QuickJsContext
[src]
pub unsafe fn get_id(context: *mut JSContext) -> &'static str
[src]
get the id of a QuickJsContext from a JSContext
Safety
when passing a context ptr please be sure that the corresponding QuickJsContext is still active
pub fn call_function(
&self,
namespace: Vec<&str>,
func_name: &str,
arguments: Vec<JSValueRef>
) -> Result<JSValueRef, EsError>
[src]
&self,
namespace: Vec<&str>,
func_name: &str,
arguments: Vec<JSValueRef>
) -> Result<JSValueRef, EsError>
call a function by namespace and name
pub fn eval(&self, script: EsScript) -> Result<JSValueRef, EsError>
[src]
evaluate a script
pub unsafe fn eval_ctx(
context: *mut JSContext,
script: EsScript
) -> Result<JSValueRef, EsError>
[src]
context: *mut JSContext,
script: EsScript
) -> Result<JSValueRef, EsError>
Safety
when passing a context ptr please be sure that the corresponding QuickJsContext is still active
pub fn eval_module(&self, script: EsScript) -> Result<JSValueRef, EsError>
[src]
evaluate a Module
pub unsafe fn eval_module_ctx(
context: *mut JSContext,
script: EsScript
) -> Result<JSValueRef, EsError>
[src]
context: *mut JSContext,
script: EsScript
) -> Result<JSValueRef, EsError>
Safety
when passing a context ptr please be sure that the corresponding QuickJsContext is still active
pub fn report_ex(&self, err: &str) -> JSValue
[src]
throw an internal error to quickjs and create a new ex obj
pub unsafe fn report_ex_ctx(context: *mut JSContext, err: &str) -> JSValue
[src]
throw an Error in the runtime and init an Exception JSValue to return
Safety
when passing a context ptr please be sure that the corresponding QuickJsContext is still active
pub fn get_exception_ctx(&self) -> Option<EsError>
[src]
Get the last exception from the runtime, and if present, convert it to a EsError.
pub unsafe fn get_exception(context: *mut JSContext) -> Option<EsError>
[src]
Get the last exception from the runtime, and if present, convert it to a EsError.
Safety
When passing a context pointer please make sure the corresponding QuickJsContext is still valid
pub fn cache_object(&self, obj: JSValueRef) -> i32
[src]
pub fn remove_cached_obj_if_present(&self, id: i32)
[src]
pub fn consume_cached_obj(&self, id: i32) -> JSValueRef
[src]
pub fn with_cached_obj<C, R>(&self, id: i32, consumer: C) -> R where
C: FnOnce(JSValueRef) -> R,
[src]
C: FnOnce(JSValueRef) -> R,
pub unsafe fn with_context<C, R>(context: *mut JSContext, consumer: C) -> R where
C: FnOnce(&QuickJsContext) -> R,
[src]
C: FnOnce(&QuickJsContext) -> R,
Safety
When passing a context pointer please make sure the corresponding QuickJsContext is still valid
Trait Implementations
impl Drop for QuickJsContext
[src]
Auto Trait Implementations
impl !RefUnwindSafe for QuickJsContext
impl !Send for QuickJsContext
impl !Sync for QuickJsContext
impl Unpin for QuickJsContext
impl !UnwindSafe for QuickJsContext
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, 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,