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::UnsupportedFormatfor aformat_versionother than 2 or 3.ItzmaError::CorruptSegmentfor anything else wrong with the bytes: truncation, bad magic, a dimension different fromdim, 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.