class CargoMetaAnalyzer extends AbstractMetaAnalyzer {

    private static final Logger LOGGER = Logger.getLogger(CargoMetaAnalyzer.class);
    private static final String DEFAULT_BASE_URL = "https://crates.io";
    private static final String API_URL = "/api/v1/crates/%s";

    CargoMetaAnalyzer() {
        this.baseUrl = DEFAULT_BASE_URL;
    }

    /**
     * {@inheritDoc}
     */
    public boolean isApplicable(final Component component) {
        return component.getPurl() != null && PackageURL.StandardTypes.CARGO.equals(component.getPurl().getType());
    }

    /**
     * {@inheritDoc}
     */
    public RepositoryType supportedRepositoryType() {
        return RepositoryType.CARGO;
    }

    /**
     * {@inheritDoc}
     */
    public MetaModel analyze(final Component component) {<FILL_FUNCTION_BODY>}
}

        final MetaModel meta = new MetaModel(component);
        if (component.getPurl() != null) {
            final String url = String.format(baseUrl + API_URL, component.getPurl().getName());
            try (final CloseableHttpResponse response = processHttpRequest(url)) {
                if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
                    final HttpEntity entity = response.getEntity();
                    if (entity != null) {
                        String responseString = EntityUtils.toString(entity);
                        var jsonObject = new JSONObject(responseString);
                        final JSONObject crate = jsonObject.optJSONObject("crate");
                        if (crate != null) {
                            final String latest = crate.getString("newest_version");
                            meta.setLatestVersion(latest);
                        }
                        final JSONArray versions = jsonObject.optJSONArray("versions");
                        if (versions != null) {
                            for (int i = 0; i < versions.length(); i++) {
                                final JSONObject version = versions.getJSONObject(i);
                                final String versionString = version.optString("num");
                                if (meta.getLatestVersion() != null && meta.getLatestVersion().equals(versionString)) {
                                    final String publishedTimestamp = version.optString("created_at");
                                    try {
                                        meta.setPublishedTimestamp(DateUtil.fromISO8601(publishedTimestamp));
                                    } catch (IllegalArgumentException e) {
                                        LOGGER.warn("An error occurred while parsing published time", e);
                                    }
                                }
                            }
                        }
                    }
                } else {
                    handleUnexpectedHttpResponse(LOGGER, url, response.getStatusLine().getStatusCode(), response.getStatusLine().getReasonPhrase(), component);
                }
            } catch (IOException ex) {
                handleRequestException(LOGGER, ex);
            } catch (Exception ex) {
                throw new MetaAnalyzerException(ex);
            }
        }
        return meta;
    
<methods>public non-sealed void <init>() ,public void setRepositoryBaseUrl(java.lang.String) ,public void setRepositoryUsernameAndPassword(java.lang.String, java.lang.String) <variables>protected java.lang.String baseUrl,protected java.lang.String password,protected java.lang.String username