pub enum ObjKind {
Show 15 variants
Plain,
Array(Vec<Value>),
Function(FunctionData),
Native {
name: String,
func: NativeFn,
},
DomElement(usize),
Host(String),
MapObj(Vec<(Value, Value)>),
SetObj(Vec<Value>),
PromiseObj(Rc<RefCell<PromiseState>>),
Resolver {
state: Rc<RefCell<PromiseState>>,
reject: bool,
},
Generator(Rc<RefCell<GenState>>),
RegExpObj(Rc<RefCell<RegExpData>>),
Proxy {
target: ObjRef,
handler: ObjRef,
},
Bound {
target: Value,
bound_this: Value,
bound_args: Vec<Value>,
},
DateObj(f64),
}Expand description
オブジェクトの種別。Plain 以外は内部表現を持つ。
Variants§
Plain
Array(Vec<Value>)
Function(FunctionData)
Native
DomElement(usize)
DOM 要素ハンドル(DOMアリーナのノード index を保持)。
Host(String)
document などのホストオブジェクト識別子。
MapObj(Vec<(Value, Value)>)
Map: 挿入順を保つ (key, value) リスト(キー等価は SameValueZero 近似)。
SetObj(Vec<Value>)
Set: 挿入順を保つ値リスト。
PromiseObj(Rc<RefCell<PromiseState>>)
Promise。状態は共有可変(then/await で参照される)。
Resolver
resolve/reject 関数(Promise 状態を束縛したクロージャ相当)。
Generator(Rc<RefCell<GenState>>)
Generator(遅延評価。resume のたびに本体を replay して次の yield まで進める)。
RegExpObj(Rc<RefCell<RegExpData>>)
RegExp(コンパイル済みパターン + lastIndex)。
Proxy
Proxy(target とハンドラ。トラップ未定義時は target にフォワード)。
Bound
Function.prototype.bind() が返す束縛済み関数。呼び出し時は
bound_args ++ 実引数 を bound_this を this として target に渡す。
DateObj(f64)
Date。内部値は UTC エポックミリ秒(不正な日時は f64::NAN。仕様の Invalid Date 相当)。
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ObjKind
impl !Send for ObjKind
impl !Sync for ObjKind
impl !UnwindSafe for ObjKind
impl Freeze for ObjKind
impl Unpin for ObjKind
impl UnsafeUnpin for ObjKind
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