pub struct Mapping {
pub format_version: u16,
pub schema_generation: SchemaGeneration,
pub mode: IndexMode,
pub fields: BTreeMap<String, FieldMapping>,
pub extensions: MappingExtensions,
}Expand description
Normalized mapping semantics for one schema generation.
Durable catalog records own the canonical bytes for this exact type. Execution crates compile it but do not define a second mapping model.
Fields§
§format_version: u16§schema_generation: SchemaGeneration§mode: IndexMode§fields: BTreeMap<String, FieldMapping>§extensions: MappingExtensionsSemantics owned by the sole current mapping format.
Implementations§
Source§impl Mapping
impl Mapping
pub fn empty(mode: IndexMode) -> Self
Sourcepub fn normalized(self) -> Self
pub fn normalized(self) -> Self
Completes format-4 metadata whose defaults are intrinsic to the native mapping model. Adapter-specific policy defaults are never applied here.
Sourcepub fn decode_canonical(bytes: &[u8]) -> Result<Self, MappingCodecError>
pub fn decode_canonical(bytes: &[u8]) -> Result<Self, MappingCodecError>
Decodes exact canonical catalog/public bytes after a minimal, duplicate-safe current-format probe.
pub fn encode_canonical(&self) -> Result<Vec<u8>, MappingCodecError>
Sourcepub fn validate(&self) -> Result<(), MappingValidationError>
pub fn validate(&self) -> Result<(), MappingValidationError>
Validates the dependency-free semantic mapping contract.
Sourcepub fn validate_current(&self) -> Result<(), MappingValidationError>
pub fn validate_current(&self) -> Result<(), MappingValidationError>
Validates a mapping admitted for a new index or successor generation.
Sourcepub fn is_additive_successor_of(&self, predecessor: &Self) -> bool
pub fn is_additive_successor_of(&self, predecessor: &Self) -> bool
Returns whether self is an additive successor of predecessor.
This is the shared semantic check used before entering the catalog CAS. Existing field definitions and every format-4 extension identity are immutable; a successor may only append new definitions and their matching metadata.