pub enum ValidationError {
ExceedsMaxLength,
ContainsInvalidCharacters,
StartsWithUnderscore,
EndsWithUnderscore,
InvalidStartCharacter,
InvalidEndCharacter,
IsEmpty,
}Expand description
Re-exports from the typeid_prefix crate, including TypeIdPrefix and related types.
Represents errors that can occur during validation of TypeID prefixes.
This enum encapsulates various error conditions that may arise when validating
a TypeID prefix according to the TypeID specification.
Variants§
ExceedsMaxLength
The input exceeds the maximum allowed length of 63 characters.
ContainsInvalidCharacters
The input contains characters that are not allowed in a TypeID prefix.
Valid characters are lowercase ASCII letters and underscores.
StartsWithUnderscore
The input starts with an underscore, which is not allowed.
EndsWithUnderscore
The input ends with an underscore, which is not allowed.
InvalidStartCharacter
The input does not start with a lowercase alphabetic character.
InvalidEndCharacter
The input does not end with a lowercase alphabetic character.
IsEmpty
The input is an empty string, which is not allowed.
Trait Implementations§
Source§impl Clone for ValidationError
impl Clone for ValidationError
Source§fn clone(&self) -> ValidationError
fn clone(&self) -> ValidationError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ValidationError
impl Debug for ValidationError
Source§impl Display for ValidationError
impl Display for ValidationError
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Formats the ValidationError for display.
This implementation provides human-readable error messages for each variant
of the ValidationError enum.
§Examples
use typeid_prefix::ValidationError;
let error = ValidationError::ExceedsMaxLength;
assert_eq!(error.to_string(), "Input exceeds 63 characters");Source§impl Error for ValidationError
Implements the standard Error trait for ValidationError.
impl Error for ValidationError
Implements the standard Error trait for ValidationError.
This allows ValidationError to be used with the std::error::Error trait,
enabling better interoperability with error handling mechanisms in Rust.