pub fn new() -> Result<Self, Error> {
        let iat = OffsetDateTime::now_utc();
        let nbf = iat;
        let mut exp = iat;
        exp += Duration::hours(1);

        let mut claims = Self {
            list_of: HashMap::new(),
        };

        claims.issued_at(&iat.format(&Rfc3339).map_err(|_| Error::InvalidClaim)?)?;
        claims.not_before(&nbf.format(&Rfc3339).map_err(|_| Error::InvalidClaim)?)?;
        claims.expiration(&exp.format(&Rfc3339).map_err(|_| Error::InvalidClaim)?)?;

        Ok(claims)
    }
/// Create a new `Claims` instance, setting:
/// - `iat`, `nbf` to current UTC time
/// - `exp` to one hour
///
/// Errors:
/// - If adding current time with one hour would overflow


If adding current time with one hour would overflow
If adding current time with one hour would overflow
pub fn new() -> Result<Self, Error> {
        let iat = OffsetDateTime::now_utc();
        let nbf = iat;
        let mut exp = iat;
        exp += Duration::hours(1);
        let mut claims = Self {
            list_of: HashMap::new(),
        };
        claims.issued_at(&iat.format(&Rfc3339).map_err(|_| Error::InvalidClaim)?)?;
        claims.not_before(&nbf.format(&Rfc3339).map_err(|_| Error::InvalidClaim)?)?;
        claims.expiration(&exp.format(&Rfc3339).map_err(|_| Error::InvalidClaim)?)?;
        Ok(claims)
    }
pub fn new ( ) -> Result < Self , Error > { let iat = OffsetDateTime :: now_utc ( ) ; let nbf = iat ; let mut exp = iat ; exp += Duration :: hours ( 1 ) ; let mut claims = Self { list_of : HashMap :: new ( ) , } ; claims . issued_at ( & iat . format ( & Rfc3339 ) . map_err ( | _ | Error :: InvalidClaim ) ? ) ? ; claims . not_before ( & nbf . format ( & Rfc3339 ) . map_err ( | _ | Error :: InvalidClaim ) ? ) ? ; claims . expiration ( & exp . format ( & Rfc3339 ) . map_err ( | _ | Error :: InvalidClaim ) ? ) ? ; Ok ( claims ) }
Create a new `Claims` instance, setting:
 `iat`, `nbf` to current UTC time
 `exp` to one hour
Create a new ` Claims ` instance setting : ` iat ` ` nbf ` to current UTC time ` exp ` to one hour