Skip to main content

encode_with_schema

Function encode_with_schema 

Source
pub fn encode_with_schema(
    layer: &Layer,
    schema: &Schema,
    version: u32,
) -> Result<Bytes>
Expand description

Encode a layer as the segment object compact writes at version for a namespace with schema: at version 3 a typed namespace’s attributes become columns and zone maps. Versions 1 and 2 ignore the attribute schema, so this equals encode_as there.

§Errors

As encode_as, plus ItzmaError::CorruptSegment at version 3 for a document whose attributes the schema does not allow, which a strict write never stores.