pub fn encode_index_key(
spec: &IndexSpec,
fields: &[Dynamic],
) -> Result<EncodedIndexKey>Expand description
Encode fields into a single index key under the kind-specific
rules.
Standard,Unique,Each:fields.len()must be 1; the output is the order-preserving encoding of that field, with no envelope tag. The caller appends theIdsuffix for non-unique kinds.Composite:fields.len()must equalspec.key_paths.len()(≥ 2 byIndexSpec::validate); the output is the composite-envelope tag (0x80) followed by the concatenated per-field encodings.
§Errors
Error::InvalidArgumentiffields.len()disagrees with the kind’s per-spec contract.Error::Codecif aStringfield contains an embedded0x00byte.