A library to work with Javascript Object Signing and Encryption(JOSE),
including JSON Web Tokens (JWT), JSON Web Signature (JWS) and JSON Web Encryption (JWE).
#[derive(Debug, Eq, PartialEq, Clone, Copy)]/// Defines whether a claim is validated or not
////// The generic type T is used as the "options" for validating claims and is
/// specific to each claim being validated. Refer to [`crate::ValidationOptions`]
/// for the specifics of each claim.
#[derive(Default)]pubenumValidation<T> {/// This claim is not validated
#[default]
Ignored,/// Validate this claim with type T.
/// Refer to [`crate::ValidationOptions`] for the specifics of each claim.
Validate(T),}impl<T>Validation<T>{/// Map the value to another validation requirement, similar to how .map works on iter()
pubfnmap<U, F>(self, f: F)->Validation<U>where
F: FnOnce(T) -> U,
{matchself{Validation::Ignored =>Validation::Ignored,Validation::Validate(t)=>Validation::Validate(f(t)),}}}