Skip to main content

qubit_argument/argument/constraint/
pattern_expectation.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//! Pattern expectations used by string validation.
9
10/// Whether a string is expected to match a pattern.
11///
12/// # Examples
13///
14/// ```
15/// use qubit_argument::PatternExpectation;
16///
17/// let expectation = PatternExpectation::Match;
18/// assert!(matches!(expectation, PatternExpectation::Match));
19/// ```
20///
21/// ```compile_fail
22/// #![deny(unused_must_use)]
23/// use qubit_argument::PatternExpectation;
24///
25/// PatternExpectation::Match;
26/// ```
27#[must_use]
28#[derive(Debug, Clone, Copy, PartialEq, Eq)]
29pub enum PatternExpectation {
30    /// Requires the string to match the pattern.
31    Match,
32    /// Requires the string not to match the pattern.
33    NoMatch,
34}