qubit-codec-binary 0.1.0

Buffer-oriented binary codecs for Rust
Documentation
// =============================================================================
//    Copyright (c) 2026 Haixing Hu.
//
//    SPDX-License-Identifier: Apache-2.0
//
//    Licensed under the Apache License, Version 2.0.
// =============================================================================
use thiserror::Error;

/// Classifies failures detected while decoding LEB128 integers.
#[derive(Clone, Copy, Debug, Eq, Error, PartialEq)]
pub enum Leb128DecodeErrorKind {
    /// The input ended before a terminating LEB128 byte was available.
    #[error("incomplete LEB128 integer")]
    Incomplete,

    /// The input bytes cannot represent a value of the requested width.
    #[error("malformed LEB128 integer")]
    Malformed,

    /// Strict decoding rejected a value that was not minimally encoded.
    #[error("non-canonical LEB128 integer")]
    NonCanonical,
}