#[repr(C)]pub struct RecordSchema {
pub identity: SchemaIdentity,
pub fields: &'static [RecordField],
}Expand description
The static shape of a record: what type it is, plus an ordered list of named fields, each with its value descriptor. Allocated in the JIT generation that built it (or, for parser templates, in the runtime’s schema registry).
Fields§
§identity: SchemaIdentity§fields: &'static [RecordField]Implementations§
Source§impl RecordSchema
impl RecordSchema
Sourcepub fn same_type(&self, other: &RecordSchema) -> bool
pub fn same_type(&self, other: &RecordSchema) -> bool
Whether two schemas describe the same record type — the same identity and the same field shape.
Type identity, not allocation identity. Schemas are interned per def
within a generation, and there are three producers — every JIT
generation, the runtime’s parser registry, and test fixtures — so a
pa.schema != pb.schema test would call two records of one type unequal
as soon as they came from different compiles. The debugger depends on
this directly: p evaluates in its own module, and its result is
compared against program values.
The shape is compared even for a Nominal pair, which the name alone
would settle. It costs an arity check and a slice walk, and it is what
keeps two instantiations of a generic record (one name, different field
descriptors) apart, and what stops a debugger session that reloaded a
changed definition from comparing old values field-wise through new
descriptors.