pub struct JSObject {
pub prototype: Option<*mut JSObject>,
pub gc_slot: u32,
pub shape_id_cache: usize,
/* private fields */
}Fields§
§prototype: Option<*mut JSObject>§gc_slot: u32§shape_id_cache: usizeImplementations§
Source§impl JSObject
impl JSObject
pub fn ensure_extra(&mut self) -> &mut ObjectExtra
pub fn new_typed(obj_type: ObjectType) -> Self
pub fn new_typed_from_pool(obj_type: ObjectType, props: SmallPropVec) -> Self
pub fn new() -> Self
pub fn new_global() -> Self
pub fn new_array() -> Self
pub fn new_function() -> Self
pub fn new_bigint() -> Self
pub fn new_regexp() -> Self
pub fn new_promise() -> Self
pub fn new_error() -> Self
pub fn obj_type(&self) -> ObjectType
pub fn set_obj_type(&mut self, t: ObjectType)
pub fn is_array(&self) -> bool
pub fn is_promise(&self) -> bool
pub fn is_dense_array(&self) -> bool
pub fn set_dense_array_flag(&mut self)
pub fn set_prototype_raw(&mut self, ptr: *mut JSObject)
pub fn prototype_ptr(&self) -> Option<*mut JSObject>
pub fn extensible(&self) -> bool
pub fn set_extensible(&mut self, val: bool)
pub fn sealed(&self) -> bool
pub fn set_sealed(&mut self, val: bool)
pub fn frozen(&self) -> bool
pub fn set_frozen(&mut self, val: bool)
pub fn is_mapped_arguments(&self) -> bool
pub fn mapped_args_frame_index(&self) -> usize
pub fn mapped_args_param_count(&self) -> u32
pub fn is_generator(&self) -> bool
pub fn set_is_generator(&mut self, val: bool)
pub fn get_bigint_value(&self) -> i128
pub fn set_bigint_value(&mut self, val: i128)
pub fn ensure_elements(&mut self) -> &mut Vec<JSValue>
pub fn set_array_elements(&mut self, elements: Vec<JSValue>)
pub fn get_compiled_regex(&self) -> Option<&Regex>
pub fn set_compiled_regex(&mut self, re: Regex)
pub fn get_generator_state(&self) -> Option<&GeneratorState>
pub fn get_generator_state_mut(&mut self) -> Option<&mut GeneratorState>
pub fn set_generator_state(&mut self, state: GeneratorState)
pub fn take_generator_state(&mut self) -> Option<Box<GeneratorState>>
pub fn get_array_buffer_data(&self) -> Option<usize>
pub fn set_array_buffer_data(&mut self, ptr: usize)
pub fn get_typed_array_kind(&self) -> Option<TypedArrayKind>
pub fn set_typed_array_kind(&mut self, kind: TypedArrayKind)
pub fn array_elements_len(&self) -> usize
pub fn get_array_elements(&self) -> Option<&Vec<JSValue>>
pub fn for_each_array_element(&self, f: impl FnMut(&JSValue))
pub fn get_private_field(&self, atom: Atom) -> Option<JSValue>
pub fn has_private_field(&self, atom: Atom) -> bool
pub fn set_private_field(&mut self, atom: Atom, value: JSValue)
pub fn for_each_private_field(&self, f: impl FnMut(Atom, JSValue))
pub fn ensure_shape(&mut self, cache: &mut ShapeCache) -> NonNull<Shape>
pub fn find_offset(&self, prop: Atom) -> Option<usize>
pub fn is_property_writable(&self, prop: Atom) -> bool
pub fn is_prop_writable_at(&self, offset: Option<usize>) -> bool
pub fn get_by_offset(&self, offset: usize) -> Option<JSValue>
pub fn get_by_offset_fast(&self, offset: usize) -> JSValue
pub fn has_no_deleted_props(&self) -> bool
pub fn shape_ptr(&self) -> Option<NonNull<Shape>>
pub fn set_by_offset(&mut self, offset: usize, value: JSValue) -> bool
pub fn push_prop_with_shape( &mut self, offset: usize, atom: Atom, value: JSValue, new_shape: NonNull<Shape>, )
pub fn fast_init_from_simple_constructor<I>( &mut self, props: I, final_shape: NonNull<Shape>, )
pub fn batch_push_props( &mut self, atoms: &[Atom], values: &[JSValue], new_shape: NonNull<Shape>, )
pub fn get_own_accessor_value(&self, prop: Atom) -> Option<JSValue>
pub fn get_own_accessor_entry(&self, prop: Atom) -> Option<&AccessorEntry>
pub fn define_accessor( &mut self, prop: Atom, getter: Option<JSValue>, setter: Option<JSValue>, )
pub fn get_own_private_accessor_entry( &self, prop: Atom, ) -> Option<&AccessorEntry>
pub fn define_private_accessor( &mut self, prop: Atom, getter: Option<JSValue>, setter: Option<JSValue>, )
pub fn get_own_value(&self, prop: Atom) -> Option<JSValue>
pub fn get(&self, prop: Atom) -> Option<JSValue>
pub fn set(&mut self, prop: Atom, value: JSValue)
pub fn set_length(&mut self, prop: Atom, value: JSValue)
pub fn set_length_ic( &mut self, prop: Atom, value: JSValue, cache: &mut ShapeCache, )
pub fn set_cached_non_configurable( &mut self, prop: Atom, value: JSValue, cache: &mut ShapeCache, )
pub fn set_with_cache( &mut self, prop: Atom, value: JSValue, cache: &mut ShapeCache, )
pub fn set_cached(&mut self, prop: Atom, value: JSValue, cache: &mut ShapeCache)
pub fn set_cached_with_offset( &mut self, prop: Atom, value: JSValue, cache: &mut ShapeCache, pre_offset: Option<usize>, )
pub fn set_cached_non_enumerable( &mut self, prop: Atom, value: JSValue, cache: &mut ShapeCache, )
pub fn define_cached( &mut self, prop: Atom, value: JSValue, cache: &mut ShapeCache, )
pub fn get_own(&self, prop: Atom) -> Option<JSValue>
pub fn own_properties(&self) -> Vec<(Atom, JSValue)>
pub fn get_own_descriptor(&self, prop: Atom) -> Option<PropertyDescriptor>
pub fn define_property(&mut self, prop: Atom, desc: PropertyDescriptor) -> bool
pub fn delete(&mut self, prop: Atom) -> bool
pub fn add_property_ic( &mut self, atom: Atom, value: JSValue, offset: usize, new_shape: NonNull<Shape>, )
pub fn compact_props(&mut self, cache: &mut ShapeCache)
pub fn has_property(&self, prop: Atom) -> bool
pub fn has_own(&self, prop: Atom) -> bool
pub fn keys(&self) -> Vec<Atom>
pub fn all_keys(&self) -> Vec<Atom>
pub fn symbol_keys(&self) -> Vec<JSValue>
pub fn enumerable_keys(&self) -> Vec<Atom>
pub fn for_each_property<F: FnMut(Atom, JSValue, u8)>(&self, f: F)
pub fn for_each_accessor<F: FnMut(Atom, Option<JSValue>, Option<JSValue>)>( &self, f: F, )
pub fn get_private_accessors_for_gc(&self) -> Option<Vec<JSValue>>
pub fn for_each_property_attrs_mut<F: FnMut(Atom, JSValue, &mut u8)>( &mut self, f: F, )
pub fn get_indexed(&self, index: usize) -> Option<JSValue>
pub fn get_dense_slice(&self, len: usize) -> Option<&[JSValue]>
pub fn set_first_prop_with_shape( &mut self, atom: Atom, value: JSValue, attrs: u8, shape: NonNull<Shape>, )
pub fn set_indexed(&mut self, index: usize, value: JSValue)
pub fn maybe_set_indexed(&mut self, index: usize, value: JSValue) -> bool
pub fn array_len(&self) -> usize
pub fn has_dense_storage(&self) -> bool
pub fn get_shape_id(&self) -> Option<ShapeId>
pub fn get_shape_ptr(&self) -> Option<NonNull<Shape>>
pub fn props_len(&self) -> usize
pub fn take_props(&mut self) -> SmallPropVec
pub fn clean_stale_properties(&mut self, heap: &GcHeap)
pub fn get_inline_value_at(&self, offset: usize) -> Option<JSValue>
pub fn get_shape(&self) -> Option<NonNull<Shape>>
pub fn assign_shape_from_existing_props(&mut self, cache: &mut ShapeCache)
pub fn inline_values_len(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JSObject
impl !RefUnwindSafe for JSObject
impl !Send for JSObject
impl !Sync for JSObject
impl Unpin for JSObject
impl UnsafeUnpin for JSObject
impl !UnwindSafe for JSObject
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