Skip to main content

ObjectKind

Enum ObjectKind 

Source
#[repr(u8)]
pub enum ObjectKind {
Show 21 variants Ordinary = 0, Array = 1, Function = 2, Scope = 3, GlobalObject = 4, Arguments = 5, RegExp = 6, ForInIterator = 7, Native = 8, StringWrapper = 9, NumberWrapper = 10, BooleanWrapper = 11, SymbolWrapper = 12, BigIntWrapper = 13, Date = 14, BoundFunction = 15, Proxy = 16, TypedArray = 17, ModuleNamespace = 18, Builtin = 19, Free = 20,
}

Variants§

§

Ordinary = 0

§

Array = 1

§

Function = 2

§

Scope = 3

A closure environment: slots holds the variables, payload the parent scope (or NONE).

§

GlobalObject = 4

§

Arguments = 5

An arguments object. Its elements hold the values of unmapped indices; a mapped one’s payload is a scope object whose slot 0 is the mapped count and slots 1.. the parameters’ cells, Value::EMPTY once an index is unmapped. An unmapped one’s payload is NONE.

§

RegExp = 6

A regular expression: payload indexes the runtime’s program store; lastIndex is an own data property.

§

ForInIterator = 7

A for-in enumeration, never exposed to JavaScript: the elements are the key snapshot, slot 0 the object, slot 1 the key count, payload the cursor.

§

Native = 8

A plain kind no builtin allocates: a host function is a ObjectKind::Function with a native index.

§

StringWrapper = 9

new String(s): internal slot 0 the string. Its indices are exotic; length is an own data property.

§

NumberWrapper = 10

new Number(n): internal slot 0 the number.

§

BooleanWrapper = 11

new Boolean(b): internal slot 0 the boolean.

§

SymbolWrapper = 12

Object(symbol): internal slot 0 the symbol.

§

BigIntWrapper = 13

Object(bigint): internal slot 0 the BigInt.

§

Date = 14

A Date: internal slot 0 the time value.

§

BoundFunction = 15

A bound function: internal slots the target, the bound this, then the bound arguments.

§

Proxy = 16

A proxy: internal slot 0 the target, slot 1 the handler (null once revoked).

§

TypedArray = 17

A typed array: internal slot 0 the buffer, the data its view. Canonical numeric keys are its elements, never properties.

§

ModuleNamespace = 18

A module namespace: internal slot 0 the module, then per export (the data’s sorted keys) its cell or, for a namespace export, its module.

§

Builtin = 19

An object whose internal slots hold builtin state the natives read: iterators, promises, collections and the like. Internal::tag says which.

§

Free = 20

Poison written over a freed header.

Implementations§

Source§

impl ObjectKind

Source

pub const fn has_internal(self) -> bool

Kinds whose payload indexes an Internal record.

Source

pub const fn has_elements(self) -> bool

Kinds whose index properties may live in the element range.

Source

pub const fn is_exotic(self) -> bool

Kinds whose internal methods are not the ordinary ones for every key: property lookups that meet one leave the heap-only fast paths for vm::property’s dispatch.

Trait Implementations§

Source§

impl Clone for ObjectKind

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ObjectKind

Source§

impl Debug for ObjectKind

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for ObjectKind

Source§

impl Hash for ObjectKind

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ObjectKind

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ObjectKind

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.