Skip to main content

JSObject

Struct JSObject 

Source
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: usize

Implementations§

Source§

impl JSObject

Source

pub fn ensure_extra(&mut self) -> &mut ObjectExtra

Source

pub fn new_typed(obj_type: ObjectType) -> Self

Source

pub fn new_typed_from_pool(obj_type: ObjectType, props: SmallPropVec) -> Self

Source

pub fn new() -> Self

Source

pub fn new_global() -> Self

Source

pub fn new_array() -> Self

Source

pub fn new_function() -> Self

Source

pub fn new_bigint() -> Self

Source

pub fn new_regexp() -> Self

Source

pub fn new_promise() -> Self

Source

pub fn new_error() -> Self

Source

pub fn obj_type(&self) -> ObjectType

Source

pub fn set_obj_type(&mut self, t: ObjectType)

Source

pub fn is_array(&self) -> bool

Source

pub fn is_promise(&self) -> bool

Source

pub fn is_dense_array(&self) -> bool

Source

pub fn set_dense_array_flag(&mut self)

Source

pub fn set_prototype_raw(&mut self, ptr: *mut JSObject)

Source

pub fn prototype_ptr(&self) -> Option<*mut JSObject>

Source

pub fn extensible(&self) -> bool

Source

pub fn set_extensible(&mut self, val: bool)

Source

pub fn sealed(&self) -> bool

Source

pub fn set_sealed(&mut self, val: bool)

Source

pub fn frozen(&self) -> bool

Source

pub fn set_frozen(&mut self, val: bool)

Source

pub fn is_mapped_arguments(&self) -> bool

Source

pub fn mapped_args_frame_index(&self) -> usize

Source

pub fn mapped_args_param_count(&self) -> u32

Source

pub fn is_generator(&self) -> bool

Source

pub fn set_is_generator(&mut self, val: bool)

Source

pub fn get_bigint_value(&self) -> i128

Source

pub fn set_bigint_value(&mut self, val: i128)

Source

pub fn ensure_elements(&mut self) -> &mut Vec<JSValue>

Source

pub fn set_array_elements(&mut self, elements: Vec<JSValue>)

Source

pub fn get_compiled_regex(&self) -> Option<&Regex>

Source

pub fn set_compiled_regex(&mut self, re: Regex)

Source

pub fn get_generator_state(&self) -> Option<&GeneratorState>

Source

pub fn get_generator_state_mut(&mut self) -> Option<&mut GeneratorState>

Source

pub fn set_generator_state(&mut self, state: GeneratorState)

Source

pub fn take_generator_state(&mut self) -> Option<Box<GeneratorState>>

Source

pub fn get_array_buffer_data(&self) -> Option<usize>

Source

pub fn set_array_buffer_data(&mut self, ptr: usize)

Source

pub fn get_typed_array_kind(&self) -> Option<TypedArrayKind>

Source

pub fn set_typed_array_kind(&mut self, kind: TypedArrayKind)

Source

pub fn array_elements_len(&self) -> usize

Source

pub fn get_array_elements(&self) -> Option<&Vec<JSValue>>

Source

pub fn for_each_array_element(&self, f: impl FnMut(&JSValue))

Source

pub fn get_private_field(&self, atom: Atom) -> Option<JSValue>

Source

pub fn has_private_field(&self, atom: Atom) -> bool

Source

pub fn set_private_field(&mut self, atom: Atom, value: JSValue)

Source

pub fn for_each_private_field(&self, f: impl FnMut(Atom, JSValue))

Source

pub fn ensure_shape(&mut self, cache: &mut ShapeCache) -> NonNull<Shape>

Source

pub fn find_offset(&self, prop: Atom) -> Option<usize>

Source

pub fn is_property_writable(&self, prop: Atom) -> bool

Source

pub fn is_prop_writable_at(&self, offset: Option<usize>) -> bool

Source

pub fn get_by_offset(&self, offset: usize) -> Option<JSValue>

Source

pub fn get_by_offset_fast(&self, offset: usize) -> JSValue

Source

pub fn has_no_deleted_props(&self) -> bool

Source

pub fn shape_ptr(&self) -> Option<NonNull<Shape>>

Source

pub fn set_by_offset(&mut self, offset: usize, value: JSValue) -> bool

Source

pub fn push_prop_with_shape( &mut self, offset: usize, atom: Atom, value: JSValue, new_shape: NonNull<Shape>, )

Source

pub fn fast_init_from_simple_constructor<I>( &mut self, props: I, final_shape: NonNull<Shape>, )
where I: Iterator<Item = (Atom, JSValue)>,

Source

pub fn batch_push_props( &mut self, atoms: &[Atom], values: &[JSValue], new_shape: NonNull<Shape>, )

Source

pub fn get_own_accessor_value(&self, prop: Atom) -> Option<JSValue>

Source

pub fn get_own_accessor_entry(&self, prop: Atom) -> Option<&AccessorEntry>

Source

pub fn define_accessor( &mut self, prop: Atom, getter: Option<JSValue>, setter: Option<JSValue>, )

Source

pub fn get_own_private_accessor_entry( &self, prop: Atom, ) -> Option<&AccessorEntry>

Source

pub fn define_private_accessor( &mut self, prop: Atom, getter: Option<JSValue>, setter: Option<JSValue>, )

Source

pub fn get_own_value(&self, prop: Atom) -> Option<JSValue>

Source

pub fn get(&self, prop: Atom) -> Option<JSValue>

Source

pub fn set(&mut self, prop: Atom, value: JSValue)

Source

pub fn set_length(&mut self, prop: Atom, value: JSValue)

Source

pub fn set_length_ic( &mut self, prop: Atom, value: JSValue, cache: &mut ShapeCache, )

Source

pub fn set_cached_non_configurable( &mut self, prop: Atom, value: JSValue, cache: &mut ShapeCache, )

Source

pub fn set_with_cache( &mut self, prop: Atom, value: JSValue, cache: &mut ShapeCache, )

Source

pub fn set_cached(&mut self, prop: Atom, value: JSValue, cache: &mut ShapeCache)

Source

pub fn set_cached_with_offset( &mut self, prop: Atom, value: JSValue, cache: &mut ShapeCache, pre_offset: Option<usize>, )

Source

pub fn set_cached_non_enumerable( &mut self, prop: Atom, value: JSValue, cache: &mut ShapeCache, )

Source

pub fn define_cached( &mut self, prop: Atom, value: JSValue, cache: &mut ShapeCache, )

Source

pub fn get_own(&self, prop: Atom) -> Option<JSValue>

Source

pub fn own_properties(&self) -> Vec<(Atom, JSValue)>

Source

pub fn get_own_descriptor(&self, prop: Atom) -> Option<PropertyDescriptor>

Source

pub fn define_property(&mut self, prop: Atom, desc: PropertyDescriptor) -> bool

Source

pub fn delete(&mut self, prop: Atom) -> bool

Source

pub fn add_property_ic( &mut self, atom: Atom, value: JSValue, offset: usize, new_shape: NonNull<Shape>, )

Source

pub fn compact_props(&mut self, cache: &mut ShapeCache)

Source

pub fn has_property(&self, prop: Atom) -> bool

Source

pub fn has_own(&self, prop: Atom) -> bool

Source

pub fn keys(&self) -> Vec<Atom>

Source

pub fn all_keys(&self) -> Vec<Atom>

Source

pub fn symbol_keys(&self) -> Vec<JSValue>

Source

pub fn enumerable_keys(&self) -> Vec<Atom>

Source

pub fn for_each_property<F: FnMut(Atom, JSValue, u8)>(&self, f: F)

Source

pub fn for_each_accessor<F: FnMut(Atom, Option<JSValue>, Option<JSValue>)>( &self, f: F, )

Source

pub fn get_private_accessors_for_gc(&self) -> Option<Vec<JSValue>>

Source

pub fn for_each_property_attrs_mut<F: FnMut(Atom, JSValue, &mut u8)>( &mut self, f: F, )

Source

pub fn get_indexed(&self, index: usize) -> Option<JSValue>

Source

pub fn get_dense_slice(&self, len: usize) -> Option<&[JSValue]>

Source

pub fn set_first_prop_with_shape( &mut self, atom: Atom, value: JSValue, attrs: u8, shape: NonNull<Shape>, )

Source

pub fn set_indexed(&mut self, index: usize, value: JSValue)

Source

pub fn maybe_set_indexed(&mut self, index: usize, value: JSValue) -> bool

Source

pub fn array_len(&self) -> usize

Source

pub fn has_dense_storage(&self) -> bool

Source

pub fn get_shape_id(&self) -> Option<ShapeId>

Source

pub fn get_shape_ptr(&self) -> Option<NonNull<Shape>>

Source

pub fn props_len(&self) -> usize

Source

pub fn take_props(&mut self) -> SmallPropVec

Source

pub fn clean_stale_properties(&mut self, heap: &GcHeap)

Source

pub fn get_inline_value_at(&self, offset: usize) -> Option<JSValue>

Source

pub fn get_shape(&self) -> Option<NonNull<Shape>>

Source

pub fn assign_shape_from_existing_props(&mut self, cache: &mut ShapeCache)

Source

pub fn inline_values_len(&self) -> usize

Trait Implementations§

Source§

impl Default for JSObject

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.