fastalp 0.1.2

High-performance lossless floating-point compression in pure Rust / 基于 ALP 算法的高性能无损浮点数压缩库
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::result::Result as StdResult;

use thiserror::Error;

pub type Result<T> = StdResult<T, Error>;

#[derive(Error, Debug, Clone, PartialEq, Eq)]
pub enum Error {
  #[error("Invalid ALP header or magic bytes")]
  InvalidHeader,
  #[error("Unexpected end of buffer (needed {needed} bytes, had {available})")]
  UnexpectedEof { needed: usize, available: usize },
  #[error("Corrupted ALP bitstream or exception out of bounds: index {index} >= count {count}")]
  CorruptedData { index: usize, count: usize },
  #[error("Unsupported exponent or bit width: exp={exp}, fac={fac}, bit_width={bit_width}")]
  UnsupportedParams { exp: u8, fac: u8, bit_width: u8 },
}