#[non_exhaustive]pub enum ViolationCodeError {
Empty,
EmptySegment,
InvalidSegment,
}Expand description
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);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Empty
The complete code is empty.
EmptySegment
One dot-separated code segment is empty.
InvalidSegment
One code segment contains an invalid character or initial byte.
Trait Implementations§
Source§impl Clone for ViolationCodeError
impl Clone for ViolationCodeError
impl Copy for ViolationCodeError
Source§impl Debug for ViolationCodeError
impl Debug for ViolationCodeError
Source§impl Display for ViolationCodeError
impl Display for ViolationCodeError
impl Eq for ViolationCodeError
Source§impl Error for ViolationCodeError
impl Error for ViolationCodeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for ViolationCodeError
impl PartialEq for ViolationCodeError
impl StructuralPartialEq for ViolationCodeError
Auto Trait Implementations§
impl Forget for ViolationCodeError
impl Freeze for ViolationCodeError
impl Move for ViolationCodeError
impl RefUnwindSafe for ViolationCodeError
impl Send for ViolationCodeError
impl Sync for ViolationCodeError
impl Unpin for ViolationCodeError
impl UnsafeUnpin for ViolationCodeError
impl UnwindSafe for ViolationCodeError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more