pub enum UrnValidationError {
RequiredFieldMissing(&'static str),
InvalidFormat {
field: &'static str,
pattern: Option<Pattern>,
},
ForbiddenFieldPresent(&'static str),
NidMismatch,
InvalidNidLength,
InvalidNidStart,
InvalidNidCharacters,
}Expand description
Errors that can occur during URN validation and construction
Variants§
RequiredFieldMissing(&'static str)
A required field is missing
InvalidFormat
A field has an invalid format
ForbiddenFieldPresent(&'static str)
A forbidden field is present
NidMismatch
NID does not match the spec’s expected NID
InvalidNidLength
NID length is invalid (must be 2-32 characters)
InvalidNidStart
NID must start with a letter
InvalidNidCharacters
NID contains invalid characters (must be alphanumeric and hyphens only)
Trait Implementations§
Source§impl Clone for UrnValidationError
impl Clone for UrnValidationError
Source§fn clone(&self) -> UrnValidationError
fn clone(&self) -> UrnValidationError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UrnValidationError
impl Debug for UrnValidationError
Source§impl Display for UrnValidationError
impl Display for UrnValidationError
Source§impl Error for UrnValidationError
impl Error for UrnValidationError
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 From<TightBeamError> for UrnValidationError
impl From<TightBeamError> for UrnValidationError
Source§fn from(err: TightBeamError) -> Self
fn from(err: TightBeamError) -> Self
Converts to this type from the input type.
Source§impl From<UrnValidationError> for TightBeamError
impl From<UrnValidationError> for TightBeamError
Source§fn from(err: UrnValidationError) -> Self
fn from(err: UrnValidationError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for UrnValidationError
impl PartialEq for UrnValidationError
impl Eq for UrnValidationError
impl StructuralPartialEq for UrnValidationError
Auto Trait Implementations§
impl Freeze for UrnValidationError
impl RefUnwindSafe for UrnValidationError
impl Send for UrnValidationError
impl Sync for UrnValidationError
impl Unpin for UrnValidationError
impl UnsafeUnpin for UrnValidationError
impl UnwindSafe for UrnValidationError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more