cloudini 0.3.2

The cloudini point cloud compression library for Rust.
Documentation
/// All errors that can be returned by cloudini operations.
#[derive(Debug, thiserror::Error)]
pub enum Error {
    /// The input is shorter than the minimum Cloudini header size.
    #[error("input too small to contain a Cloudini header")]
    TooSmall,

    /// The magic bytes at the start of the buffer do not match `CLOUDINI_V`.
    #[error("invalid magic header (got {got:?})")]
    InvalidMagic { got: String },

    /// The version number in the header is not supported by this build.
    #[error("unsupported encoding version {got} (current: {current})")]
    UnsupportedVersion { got: u8, current: u8 },

    /// The YAML or binary header is structurally invalid.
    #[error("malformed header: {0}")]
    MalformedHeader(String),

    /// `point_step` in [`crate::EncodingInfo`] is zero.
    #[error("point_step cannot be 0")]
    ZeroPointStep,

    /// The raw cloud data length is not a multiple of `point_step`.
    #[error("cloud data length is not a multiple of point_step")]
    DataLengthMismatch,

    /// Compressed data is truncated, corrupt, or internally inconsistent.
    #[error("truncated or corrupt data: {0}")]
    Truncated(String),

    /// LZ4 compression or decompression failed.
    #[error("LZ4 error: {0}")]
    Lz4(String),

    /// ZSTD compression or decompression failed.
    #[error("ZSTD error: {0}")]
    Zstd(String),

    /// The C++ binding returned an error (feature `use_cpp`).
    #[cfg(feature = "use_cpp")]
    #[error("C++ binding error: {0}")]
    Cpp(String),
}

/// Convenience alias so callers can write `cloudini::Result<T>`.
pub type Result<T> = std::result::Result<T, Error>;