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: hub.rs
    path of file: ./repos/ajour/crates/core/src/repository/backend
    
    the code of the file until where you have to start completion: use super::*;
use crate::config::Flavor;
use crate::error::{DownloadError, RepositoryError};
use crate::network::post_json_async;
use crate::repository::{ReleaseChannel, RemotePackage, RepositoryKind, RepositoryPackage};

use async_trait::async_trait;
use chrono::{DateTime, Utc};
use isahc::AsyncReadResponseExt;
use serde::{Deserialize, Serialize};

use std::collections::HashMap;

const API_ENDPOINT: &str = "https://hub.wowup.io";

#[derive(Debug, Clone)]
pub struct Hub {
    pub id: String,
    pub flavor: Flavor,
}

#[async_trait]
impl Backend for Hub {
    async fn get_metadata(&self) -> Result<RepositoryMetadata, RepositoryError> {
        let packages = fetch_remote_packages(self.flavor, &[self.id.clo
    
pub(crate) fn metadata_from_hub_package(flavor: Flavor, package: HubPackage) -> RepositoryMetadata {
    let mut remote_packages = HashMap::new();

    for release in package.releases.iter() {
        if let Some(game_version) = release
            .game_versions
            .iter()
            .find(|gv| gv.game_type == flavor)
        {
            let version = game_version.version.clone();
            let download_url = release.download_url.clone();
            let date_time = Some(release.published_at);

            let package = RemotePackage {
                version,
                download_url,
                date_time,
                file_id: Some(release.id),
                modules: vec![],
            };

            if release.prerelease {
                remote_packages.insert(ReleaseChannel::Beta, package);
            } else {
                remote_packages.insert(ReleaseChannel::Stable, package);
            }
        }
    }

    let mut metadata = RepositoryMetadata::empty();
    metadata.remote_packages = remote_packages;
    metadata.website_url = Some(package.repository.clone());
    metadata.title = Some(package.repository_name);
    metadata.author = package.owner_name;

    metadata
}