// =============================================================================
// Copyright (c) 2025 - 2026 Haixing Hu.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0.
// =============================================================================
//! Violation code protocol errors.
use Error;
/// The reason a candidate string violates the stable violation-code protocol.
///
/// # Examples
///
/// ```
/// use qubit_validator::{ViolationCode, ViolationCodeError};
///
/// let error = ViolationCode::try_new("text..blank").unwrap_err();
/// assert_eq!(error, ViolationCodeError::EmptySegment);
/// ```