Skip to main content

ExoticObject

Enum ExoticObject 

Source
pub enum ExoticObject {
Show 19 variants Ordinary, Array { elements: Vec<JsValue>, }, Boolean(bool), Number(f64), StringObj(JsString), Symbol(Box<JsSymbol>), Function(JsFunction), Map { entries: IndexMap<JsMapKey, JsValue, BuildHasherDefault<FxHasher>>, }, Set { entries: IndexSet<JsMapKey, BuildHasherDefault<FxHasher>>, }, Date { timestamp: f64, }, RegExp { pattern: String, flags: String, compiled: Option<Rc<dyn CompiledRegex>>, }, Generator(Rc<RefCell<GeneratorState>>), BytecodeGenerator(Rc<RefCell<BytecodeGeneratorState>>), Promise(Rc<RefCell<PromiseState>>), Environment(EnvironmentData), Enum(EnumData), Proxy(ProxyData), RawJSON(JsString), PendingOrder { id: u64, },
}
Expand description

Exotic object behavior

Variants§

§

Ordinary

Ordinary object

§

Array

Array exotic object - stores elements directly for O(1) indexed access

Fields

§elements: Vec<JsValue>
§

Boolean(bool)

Boolean wrapper object - stores primitive boolean value

§

Number(f64)

Number wrapper object - stores primitive number value

§

StringObj(JsString)

String wrapper object - stores primitive string value

§

Symbol(Box<JsSymbol>)

Symbol wrapper object - stores primitive symbol value

§

Function(JsFunction)

Function exotic object

§

Map

Map exotic object - stores key-value pairs preserving insertion order Uses IndexMap for O(1) lookup with SameValueZero key comparison

§

Set

Set exotic object - stores unique values preserving insertion order Uses IndexSet for O(1) lookup with SameValueZero comparison

§

Date

Date exotic object - stores timestamp in milliseconds since Unix epoch

Fields

§timestamp: f64
§

RegExp

RegExp exotic object - stores pattern, flags, and cached compiled regex

Fields

§pattern: String
§flags: String
§compiled: Option<Rc<dyn CompiledRegex>>

Cached compiled regex. Lazily compiled on first use.

§

Generator(Rc<RefCell<GeneratorState>>)

Generator exotic object - stores generator state (AST-based)

§

BytecodeGenerator(Rc<RefCell<BytecodeGeneratorState>>)

Bytecode generator exotic object - stores bytecode generator state

§

Promise(Rc<RefCell<PromiseState>>)

Promise exotic object - stores promise state

§

Environment(EnvironmentData)

Environment exotic object - stores variable bindings

§

Enum(EnumData)

Enum exotic object - stores enum metadata

§

Proxy(ProxyData)

Proxy exotic object - wraps target with handler traps

§

RawJSON(JsString)

Raw JSON exotic object - stores a JSON string for literal insertion in JSON.stringify

§

PendingOrder

Pending order marker - triggers immediate VM suspension The id is the OrderId that will be used to match the response from host When detected, VM suspends and waits for host to provide a value via fulfill_orders()

Fields

§id: u64

Trait Implementations§

Source§

impl Debug for ExoticObject

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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.