pub fn validate_exp(
        &self,
        validation: Validation<TemporalOptions>,
    ) -> Result<(), ValidationError> {
        match validation {
            Validation::Ignored => Ok(()),
            Validation::Validate(temporal_options) => {
                let now = temporal_options.now.unwrap_or_else(Utc::now);

                match self.expiry {
                    Some(Timestamp(expiry)) if now - expiry > temporal_options.epsilon => {
                        Err(ValidationError::Expired(now - expiry))
                    }
                    _ => Ok(()),
                }
            }
        }
    }
/// Validates that if the token has an `exp` claim, it has not passed.
Validates that if the token has an `exp` claim, it has not passed.
Validates that if the token has an ` exp ` claim it has not passed .
pub fn validate_exp(
        &self,
        validation: Validation<TemporalOptions>,
    ) -> Result<(), ValidationError> {
        match validation {
            Validation::Ignored => Ok(()),
            Validation::Validate(temporal_options) => {
                let now = temporal_options.now.unwrap_or_else(Utc::now);
                match self.expiry {
                    Some(Timestamp(expiry)) if now - expiry > temporal_options.epsilon => {
                        Err(ValidationError::Expired(now - expiry))
                    }
                    _ => Ok(()),
                }
            }
        }
    }
pub fn validate_exp ( & self , validation : Validation < TemporalOptions > , ) -> Result < ( ) , ValidationError > { match validation { Validation :: Ignored => Ok ( ( ) ) , Validation :: Validate ( temporal_options ) => { let now = temporal_options . now . unwrap_or_else ( Utc :: now ) ; match self . expiry { Some ( Timestamp ( expiry ) ) if now - expiry > temporal_options . epsilon => { Err ( ValidationError :: Expired ( now - expiry ) ) } _ => Ok ( ( ) ) , } } } }
Validates that if the token has an `exp` claim, it has not passed.
Validates that if the token has an ` exp ` claim it has not passed .
&self
validation
Validation<TemporalOptions>
&self
validation
Validation<TemporalOptions>