Skip to main content

encode_as

Function encode_as 

Source
pub fn encode_as(layer: &Layer, dim: usize, version: u32) -> Result<Bytes>
Expand description

Encode a layer as a segment object of version (1, 2 or 3) for vectors of length dim, with attributes stored as JSON. At version 3 that is the layout of a free-form namespace; a typed namespace’s segments are what encode_with_schema writes.

The result depends only on the layer’s contents, not on the order things were inserted. The caller decides whether tombstones belong: a base segment (range starting at 1) should have had them dropped first.

§Errors