pub struct ObjectShape {
pub flags: ObjectFlags,
pub properties: Vec<PropertyInfo>,
pub string_index: Option<IndexSignature>,
pub number_index: Option<IndexSignature>,
pub symbol: Option<SymbolId>,
}Expand description
Object type with properties and optional index signatures
NOTE: The symbol field affects BOTH Hash and PartialEq for nominal discrimination.
This ensures that different classes get different TypeIds in the interner.
Structural subtyping is computed explicitly in the Solver, not via PartialEq.
Fields§
§flags: ObjectFlagsObject-level flags (e.g. fresh literal tracking).
properties: Vec<PropertyInfo>Named properties (sorted by name for consistent hashing)
string_index: Option<IndexSignature>String index signature: { [key: string]: T }
number_index: Option<IndexSignature>Number index signature: { [key: number]: T }
symbol: Option<SymbolId>Nominal identity for class instance types (prevents structural interning of distinct classes)
Trait Implementations§
Source§impl Clone for ObjectShape
impl Clone for ObjectShape
Source§fn clone(&self) -> ObjectShape
fn clone(&self) -> ObjectShape
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ObjectShape
impl Debug for ObjectShape
Source§impl Default for ObjectShape
impl Default for ObjectShape
Source§impl Hash for ObjectShape
impl Hash for ObjectShape
Source§impl PartialEq for ObjectShape
impl PartialEq for ObjectShape
impl Eq for ObjectShape
Auto Trait Implementations§
impl Freeze for ObjectShape
impl RefUnwindSafe for ObjectShape
impl Send for ObjectShape
impl Sync for ObjectShape
impl Unpin for ObjectShape
impl UnsafeUnpin for ObjectShape
impl UnwindSafe for ObjectShape
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.