qubit-json 0.12.2

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.
// =============================================================================
//! One guarded open array or object in a lexical JSON value builder.

use std::collections::BTreeSet;

use crate::value::SafeJsonValue;

/// The container currently being materialized.
pub(crate) enum JsonValueFrame {
    /// An array whose children are independently protected values.
    Array(
        /// Child values retained while the array is being materialized.
        Vec<SafeJsonValue>,
    ),
    /// An object with a decoded key awaiting its corresponding value.
    Object {
        /// Values accumulated for this object.
        values: Vec<(String, SafeJsonValue)>,
        /// Decoded keys accepted for this object.
        keys: BTreeSet<String>,
        /// Key emitted immediately before the next value.
        pending_key: Option<String>,
    },
}