qubit_codec/transcode/capacity_error.rs
1// =============================================================================
2// Copyright (c) 2026 Haixing Hu.
3//
4// SPDX-License-Identifier: Apache-2.0
5//
6// Licensed under the Apache License, Version 2.0.
7// =============================================================================
8use thiserror::Error;
9
10/// Error reported by output-capacity planning APIs.
11///
12/// Capacity planning is separate from actual transcoding. This error means the
13/// requested upper bound cannot be represented as a `usize`; callers should
14/// reject the one-shot allocation request or switch to chunked streaming.
15#[derive(Clone, Copy, Debug, Eq, Error, Hash, PartialEq)]
16pub enum CapacityError {
17 /// The computed output length overflowed `usize`.
18 #[error("output length overflow")]
19 OutputLengthOverflow,
20}