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