Skip to main content

decode

Function decode 

Source
pub fn decode(path: &str, bytes: &[u8], dim: usize) -> Result<Layer>
Expand description

Decode a segment object (version 2 or 3) for a namespace whose vectors have length dim. path is only used to label errors.

ยงErrors

  • ItzmaError::UnsupportedFormat for a format_version other than 2 or 3.
  • ItzmaError::CorruptSegment for anything else wrong with the bytes: truncation, bad magic, a dimension different from dim, counts larger than the object can hold, ids or tombstones out of order, an id that is both a document and a tombstone, invalid UTF-8 or JSON, trailing bytes, and for version 2 a directory, block, offset or Bloom filter that does not match the content.