qubit_argument/argument/constraint/argument_bound.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//! Numeric range bound constraints.
9
10use crate::argument::ArgumentValue;
11
12/// One side of a numeric range constraint.
13///
14/// # Examples
15///
16/// ```
17/// use qubit_argument::{ArgumentBound, ArgumentValue};
18///
19/// let bound = ArgumentBound::Included(ArgumentValue::from(5_i32));
20/// assert!(matches!(bound, ArgumentBound::Included(_)));
21/// ```
22///
23/// ```compile_fail
24/// #![deny(unused_must_use)]
25/// use qubit_argument::ArgumentBound;
26///
27/// ArgumentBound::Unbounded;
28/// ```
29#[must_use]
30#[derive(Debug, Clone, PartialEq, Eq)]
31pub enum ArgumentBound {
32 /// Places no limit on this side of the range.
33 Unbounded,
34 /// Includes the captured endpoint in the range.
35 Included(ArgumentValue),
36 /// Excludes the captured endpoint from the range.
37 Excluded(ArgumentValue),
38}