pub struct JSContext {
pub finalization_registries: RefCell<Vec<usize>>,
pub pending_exception: Option<JSValue>,
pub common_atoms: CommonAtoms,
/* private fields */
}Fields§
§finalization_registries: RefCell<Vec<usize>>§pending_exception: Option<JSValue>§common_atoms: CommonAtomsImplementations§
Source§impl JSContext
impl JSContext
pub fn new(runtime: &mut JSRuntime) -> Self
pub fn check_interrupt(&mut self) -> Result<(), String>
pub fn reset_interrupt_counter(&mut self)
pub fn runtime(&self) -> &JSRuntime
pub fn runtime_mut(&mut self) -> &mut JSRuntime
pub fn atom_table(&self) -> &AtomTable
pub fn atom_table_mut(&mut self) -> &mut AtomTable
pub fn shape_cache(&self) -> &ShapeCache
pub fn shape_cache_mut(&mut self) -> &mut ShapeCache
pub fn get_or_create_args_length_shape(&mut self) -> NonNull<Shape>
pub fn global(&self) -> JSValue
pub fn set_global(&mut self, value: JSValue)
pub fn intern(&mut self, s: &str) -> Atom
pub fn intern_concat(&mut self, a: &str, b: &str) -> Atom
pub fn intern_concat_atoms(&mut self, a: Atom, b: Atom) -> Atom
pub fn int_atom(&self, n: usize) -> Atom
pub fn int_atom_mut(&mut self, n: usize) -> Atom
pub fn intern_fast(&mut self, s: &str) -> Atom
pub fn lookup_atom(&self, s: &str) -> Option<Atom>
pub fn get_atom_str(&self, atom: Atom) -> &str
pub fn string_char_count(&self, atom: Atom) -> usize
pub fn string_char_code_at(&self, atom: Atom, index: usize) -> Option<u32>
pub fn mark_symbol_atom(&mut self, atom: Atom)
pub fn is_symbol_atom(&self, atom: Atom) -> bool
pub fn register_builtin(&mut self, name: &str, func: HostFunction)
pub fn register_global_builtin( &mut self, name: &'static str, arity: u32, func: HostFunc, )
pub fn call_builtin(&mut self, name: &str, args: &[JSValue]) -> JSValue
pub fn get_builtin_func(&self, name: &str) -> Option<HostFunc>
pub fn call_builtin_direct( &mut self, func: HostFunc, args: &[JSValue], ) -> JSValue
pub fn set_string_prototype(&mut self, ptr: usize)
pub fn set_number_prototype(&mut self, ptr: usize)
pub fn set_array_prototype(&mut self, ptr: usize)
pub fn set_regexp_prototype(&mut self, ptr: usize)
pub fn set_object_prototype(&mut self, ptr: usize)
pub fn set_function_prototype(&mut self, ptr: usize)
pub fn set_map_prototype(&mut self, ptr: usize)
pub fn set_set_prototype(&mut self, ptr: usize)
pub fn get_string_prototype(&self) -> Option<*mut JSObject>
pub fn get_number_prototype(&self) -> Option<*mut JSObject>
pub fn get_array_prototype(&self) -> Option<*mut JSObject>
pub fn get_regexp_prototype(&self) -> Option<*mut JSObject>
pub fn get_object_prototype(&self) -> Option<*mut JSObject>
pub fn get_function_prototype(&self) -> Option<*mut JSObject>
pub fn get_map_prototype(&self) -> Option<*mut JSObject>
pub fn get_set_prototype(&self) -> Option<*mut JSObject>
pub fn set_weakmap_prototype(&mut self, ptr: usize)
pub fn get_weakmap_prototype(&self) -> Option<*mut JSObject>
pub fn set_weakset_prototype(&mut self, ptr: usize)
pub fn get_weakset_prototype(&self) -> Option<*mut JSObject>
pub fn set_error_prototype(&mut self, ptr: usize)
pub fn get_error_prototype(&self) -> Option<*mut JSObject>
pub fn set_type_error_prototype(&mut self, ptr: usize)
pub fn get_type_error_prototype(&self) -> Option<*mut JSObject>
pub fn set_reference_error_prototype(&mut self, ptr: usize)
pub fn get_reference_error_prototype(&self) -> Option<*mut JSObject>
pub fn set_range_error_prototype(&mut self, ptr: usize)
pub fn get_range_error_prototype(&self) -> Option<*mut JSObject>
pub fn set_syntax_error_prototype(&mut self, ptr: usize)
pub fn get_syntax_error_prototype(&self) -> Option<*mut JSObject>
pub fn set_symbol_prototype(&mut self, ptr: usize)
pub fn get_symbol_prototype(&self) -> Option<*mut JSObject>
pub fn set_weakref_prototype(&mut self, ptr: usize)
pub fn get_weakref_prototype(&self) -> Option<*mut JSObject>
pub fn set_finalization_registry_prototype(&mut self, ptr: usize)
pub fn get_finalization_registry_prototype(&self) -> Option<*mut JSObject>
pub fn set_generator_prototype(&mut self, ptr: usize)
pub fn get_generator_prototype(&self) -> Option<*mut JSObject>
pub fn set_async_generator_prototype(&mut self, ptr: usize)
pub fn get_async_generator_prototype(&self) -> Option<*mut JSObject>
pub fn set_promise_prototype(&mut self, ptr: usize)
pub fn get_promise_prototype(&self) -> Option<*mut JSObject>
pub fn set_register_vm_ptr(&mut self, ptr: Option<usize>)
pub fn get_register_vm_ptr(&self) -> Option<usize>
pub fn add_extension(&mut self, ext: Box<dyn MacroTaskExtension>)
pub fn set_compiler_opt_level(&mut self, opt_level: OptLevel)
pub fn get_compiler_opt_level(&self) -> OptLevel
pub fn set_pending_callback(&mut self, callback: PendingCallback)
pub fn take_pending_callback(&mut self) -> Option<PendingCallback>
pub fn has_pending_callback(&self) -> bool
pub fn microtask_enqueue(&mut self, task: Microtask)
pub fn microtask_is_empty(&self) -> bool
pub fn microtask_dequeue(&mut self) -> Option<Microtask>
pub fn set_current_module(&mut self, specifier: Option<String>)
pub fn get_current_module(&self) -> Option<&str>
pub fn set_import_meta(&mut self, ptr: Option<usize>)
pub fn get_import_meta(&self) -> Option<usize>
pub fn event_loop(&self) -> &EventLoop
pub fn event_loop_mut(&mut self) -> &mut EventLoop
pub fn run_event_loop(&mut self) -> Result<EventLoopResult, String>
pub fn run_event_loop_with_timeout( &mut self, timeout_ms: u64, ) -> Result<EventLoopResult, String>
Auto Trait Implementations§
impl !Freeze for JSContext
impl !RefUnwindSafe for JSContext
impl !Send for JSContext
impl !Sync for JSContext
impl Unpin for JSContext
impl UnsafeUnpin for JSContext
impl !UnwindSafe for JSContext
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