You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: jwt_manager.rs
    path of file: ./repos/iggy/server/src/http/jwt
    
    the code of the file until where you have to start completion: use crate::configs::http::HttpJwtConfig;
use crate::http::jwt::json_web_token::{GeneratedTokens, JwtClaims, RevokedAccessToken};
use crate::http::jwt::refresh_token::RefreshToken;
use crate::http::jwt::storage::TokenStorage;
use iggy::error::IggyError;
use iggy::locking::IggySharedMut;
use iggy::locking::IggySharedMutFn;
use iggy::models::user_info::UserId;
use iggy::utils::duration::IggyDuration;
use iggy::utils::timestamp::IggyTimestamp;
use jsonwebtoken::{encode, Algorithm, DecodingKey, EncodingKey, Header, TokenData, Validation};
use sled::Db;
use std::collections::HashMap;
use std::sync::Arc;
use traci
    
    pub fn generate(&self, user_id: UserId) -> Result<GeneratedTokens, IggyError> {
        let header = Header::new(self.issuer.algorithm);
        let now = IggyTimestamp::now().to_secs();
        let iat = now;
        let exp = iat + self.issuer.access_token_expiry.as_secs() as u64;
        let nbf = iat + self.issuer.not_before.as_secs() as u64;
        let claims = JwtClaims {
            jti: uuid::Uuid::new_v4().to_string(),
            sub: user_id,
            aud: self.issuer.audience.to_string(),
            iss: self.issuer.issuer.to_string(),
            iat,
            exp,
            nbf,
        };

        let access_token = encode::<JwtClaims>(&header, &claims, &self.issuer.key);
        if let Err(err) = access_token {
            error!("Cannot generate JWT token. Error: {}", err);
            return Err(IggyError::CannotGenerateJwt);
        }

        let (refresh_token, raw_refresh_token) = RefreshToken::new(
            user_id,
            now,
            self.issuer.refresh_token_expiry.as_secs() as u64,
        );
        self.tokens_storage.save_refresh_token(&refresh_token)?;

        Ok(GeneratedTokens {
            user_id,
            access_token: access_token.unwrap(),
            refresh_token: raw_refresh_token,
            access_token_expiry: exp,
            refresh_token_expiry: refresh_token.expiry,
        })
    }