qubit_codec/value/value_codec_registry_error.rs
1// =============================================================================
2// Copyright (c) 2026 Haixing Hu.
3//
4// SPDX-License-Identifier: Apache-2.0
5// =============================================================================
6
7//! Value-codec registry errors.
8
9use thiserror::Error;
10
11use crate::ValueCodecRegistrationSource;
12
13/// Failure while freezing a value-codec registry.
14#[derive(Clone, Debug, Error)]
15pub enum ValueCodecRegistryError {
16 /// Multiple registrations claim one stable ID.
17 #[error("duplicate value codec ID {id} from {sources:?}")]
18 DuplicateId {
19 /// Conflicting stable ID.
20 id: &'static str,
21 /// Registration sources in deterministic order.
22 sources: Vec<ValueCodecRegistrationSource>,
23 },
24}