qubit-json 0.12.1

Resource-aware infrastructure for lenient and strict JSON processing
Documentation
// =============================================================================
//    Copyright (c) 2025 - 2026 Haixing Hu.
//
//    SPDX-License-Identifier: Apache-2.0
//
//    Licensed under the Apache License, Version 2.0.
// =============================================================================
//! Errors reported while rendering a JSON value as JCS.

use serde_json::Error;

use crate::encode::JcsWorkingMemoryError;
use crate::encode::JsonSerializationError;

/// Describes failures encountered while rendering a JSON value as JCS.
#[must_use]
#[derive(Debug)]
pub(in crate::encode) enum JcsRendererError {
    /// The renderer exceeded its configured working-memory budget.
    WorkingMemory(JcsWorkingMemoryError),
    /// Canonical JSON serialization or output writing failed.
    Serialize(Error),
    /// A privacy-safe number classification retained from the current value.
    Number(JsonSerializationError),
    /// An auxiliary allocation could not be completed.
    Allocation,
}