qubit-json 0.12.3

Resource-aware infrastructure for lenient and strict JSON processing
Documentation
// =============================================================================
//    Copyright (c) 2026 Haixing Hu.
//
//    SPDX-License-Identifier: Apache-2.0
//
//    Licensed under the Apache License, Version 2.0.
// =============================================================================
//! Contexts for immediate validated decode failures.

/// Grammar location where a validated decode failure occurred.
///
/// # Examples
///
/// ```
/// use qubit_json::decode::JsonDecodeContext;
///
/// let context = JsonDecodeContext::ObjectKey;
/// assert_eq!(context, JsonDecodeContext::ObjectKey);
/// ```
#[non_exhaustive]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum JsonDecodeContext {
    /// A JSON value token was expected.
    Value,
    /// An object key token was expected.
    ObjectKey,
    /// A string token was being scanned.
    String,
    /// A number token was being scanned or projected.
    Number,
    /// An object colon was expected.
    Colon,
    /// An array separator or closing bracket was expected.
    ArraySeparator,
    /// An object separator or closing brace was expected.
    ObjectSeparator,
    /// The document had trailing input after its root value.
    TrailingInput,
}