Skip to main content

qubit_value/
value_missing_reason.rs

1// =============================================================================
2//    Copyright (c) 2025 - 2026 Haixing Hu.
3//
4//    SPDX-License-Identifier: Apache-2.0
5//
6//    Licensed under the Apache License, Version 2.0.
7// =============================================================================
8//! Classification independent of the source and requested value types.
9
10/// Identifies why a read could not produce a concrete value.
11///
12/// The reason is independent of the source and target types. Inspect the
13/// accompanying [`crate::ValueMissing`] accessors for those types and for a
14/// collection index when one is available.
15#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
16#[non_exhaustive]
17pub enum ValueMissingReason {
18    /// Scalar storage is unset with a declared type.
19    UnsetScalar,
20    /// Collection storage is unset with a declared element type.
21    UnsetCollection,
22    /// A concrete collection has no first item.
23    EmptyCollection,
24    /// Conversion policy classified a concrete scalar or collection item as
25    /// missing.
26    Conversion,
27}