Skip to main content

validate_writable_metadata_key

Function validate_writable_metadata_key 

Source
pub fn validate_writable_metadata_key(
    key: &str,
    schema: &TypeDefinition,
) -> Result<(), ValidationError>
Expand description

Reject any attempt to set or unset a read-only metadata key. Both engine flavours call this from their update_entity paths; the shared list ensures the mem / id / type triple stays authoritative across both, and the schema’s init_timestamp / auto_timestamp annotations are honoured on write — the engine owns those values on create (init_timestamp, set once) and on every update (auto_timestamp, re-stamped). Returns ValidationError::ReadOnlyField on rejection.