pub struct JsEngine { /* private fields */ }Implementations§
source§impl JsEngine
impl JsEngine
pub fn new() -> Self
pub fn with_interop<I: JsInterop>(interop: I) -> Self
pub fn version() -> u32
pub fn version_info() -> &'static str
pub fn interop(&self) -> Pin<&dyn JsInterop>
pub fn interop_as<I: JsInterop>(&self) -> Pin<&I>
pub fn interop_mut(&mut self) -> Pin<&mut dyn JsInterop>
pub fn interop_as_mut<I: JsInterop>(&mut self) -> Pin<&mut I>
pub fn normalize_index(&self, index: i32) -> i32
pub fn get_top(&self) -> i32
pub fn dup(&mut self, index: i32)
pub fn remove(&mut self, index: i32)
pub fn pop(&mut self)
pub fn pop_n(&mut self, n: i32)
pub fn swap(&mut self, idx1: i32, idx2: i32)
pub fn push_this(&mut self)
pub fn push_global_object(&mut self)
pub fn push_boolean(&mut self, value: bool)
pub fn push_null(&mut self)
pub fn push_undefined(&mut self)
pub fn push_i32(&mut self, value: i32)
pub fn push_u32(&mut self, value: u32)
pub fn push_number(&mut self, value: f64)
pub fn push_string(&mut self, value: &str)
pub fn push_object(&mut self) -> i32
pub fn push_ext_buffer(&mut self, data: &[u8])
pub fn push_array(&mut self) -> i32
pub fn push_function(&mut self, func_name: &str, nargs: i32)
pub fn put_prop_function(&mut self, obj_index: i32, func_name: &str, nargs: i32)
pub fn put_global_function(&mut self, func_name: &str, nargs: i32)
pub fn get_type(&self, index: i32) -> DukType
pub fn is_string(&self, index: i32) -> bool
pub fn is_number(&self, index: i32) -> bool
pub fn is_object(&self, index: i32) -> bool
pub fn is_array(&self, index: i32) -> bool
pub fn is_pure_object(&self, index: i32) -> bool
pub fn get_string(&mut self, index: i32) -> &str
pub fn get_buffer(&mut self, index: i32) -> &[u8] ⓘ
pub fn get_number(&mut self, index: i32) -> f64
pub fn get_boolean(&mut self, index: i32) -> bool
pub fn get_prop(&mut self, obj_index: i32) -> bool
pub fn put_prop(&mut self, obj_index: i32)
pub fn get_prop_string(&mut self, obj_index: i32, key: &str) -> bool
pub fn put_prop_string(&mut self, obj_index: i32, key: &str)
pub fn get_prop_index(&mut self, obj_index: i32, index: u32) -> bool
pub fn put_prop_index(&mut self, obj_index: i32, index: u32)
pub fn get_global_string(&mut self, key: &str) -> bool
pub fn put_global_string(&mut self, key: &str)
pub fn get_length(&mut self, obj_index: i32) -> usize
pub fn call_prop(&mut self, obj_index: i32, nargs: usize)
pub fn pcall(&mut self, nargs: usize) -> Result<(), i32>
pub fn pcall_method(&mut self, nargs: usize) -> Result<(), i32>
pub fn pcall_prop(&mut self, obj_index: i32, nargs: usize) -> Result<(), i32>
pub fn safe_to_lstring(&mut self, obj_index: i32) -> String
pub fn throw(&mut self)
pub fn push_context_dump(&mut self)
pub fn get_stack_dump(&mut self) -> String
pub fn eval(&mut self, code: &str) -> Result<(), JsError>
pub fn eval_file(&mut self, filename: &str, code: &str) -> Result<(), JsError>
pub fn compile(&mut self, code: &str) -> Result<(), JsError>
pub fn compile_file( &mut self, filename: &str, code: &str ) -> Result<(), JsError>
pub fn write<O: WriteJs>(&mut self, obj: &O) -> Result<(), JsError>
pub fn read<O: ReadJs>(&mut self, obj_index: i32) -> Result<O, JsError>
pub fn read_top<O: ReadJs>(&mut self) -> Result<O, JsError>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for JsEngine
impl !Send for JsEngine
impl !Sync for JsEngine
impl Unpin for JsEngine
impl !UnwindSafe for JsEngine
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more