Skip to main content

qubit_codec/value/
value_codec_id_error.rs

1// =============================================================================
2//    Copyright (c) 2026 Haixing Hu.
3//
4//    SPDX-License-Identifier: Apache-2.0
5// =============================================================================
6
7//! Stable value-codec ID errors.
8
9use thiserror::Error;
10
11/// A stable value-codec ID protocol violation.
12#[derive(Clone, Copy, Debug, Eq, Error, PartialEq)]
13pub enum ValueCodecIdError {
14    /// The complete ID is empty.
15    #[error("value codec ID cannot be empty")]
16    Empty,
17    /// One dot-separated segment is empty.
18    #[error("value codec ID contains an empty segment")]
19    EmptySegment,
20    /// One segment has an invalid initial byte or character.
21    #[error("value codec ID contains an invalid segment")]
22    InvalidSegment,
23}