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: lib.rs
    path of file: ./repos/turbo/packages/turbo-repository/rust/src
    
    the code of the file until where you have to start completion: use std::{
    collections::{HashMap, HashSet},
    hash::Hash,
};

use napi::Error;
use napi_derive::napi;
use turbopath::{AbsoluteSystemPath, AnchoredSystemPathBuf};
use turborepo_repository::{
    change_mapper::{ChangeMapper, DefaultPackageChangeMapper, PackageChanges},
    inference::RepoState as WorkspaceState,
    package_graph::{PackageGraph, PackageName, PackageNode, WorkspacePackage, ROOT_PKG_NAME},
};
mod internal;

#[napi]
#[derive(PartialEq, Eq, Hash, Clone)]
pub struct Package {
    pub name: String,
    /// The absolute path to the packa
    
    pub async fn find_packages_with_graph(&self) -> Result<HashMap<String, PackageDetails>, Error> {
        let packages = self.find_packages().await?;

        let workspace_path = match AbsoluteSystemPath::new(self.absolute_path.as_str()) {
            Ok(path) => path,
            Err(e) => return Err(Error::from_reason(e.to_string())),
        };

        let map: HashMap<String, PackageDetails> = packages
            .into_iter()
            .map(|package| {
                let details = PackageDetails {
                    dependencies: package
                        .dependencies(&self.graph, workspace_path)
                        .into_iter()
                        .map(|p| p.relative_path)
                        .collect(),
                    dependents: package
                        .dependents(&self.graph, workspace_path)
                        .into_iter()
                        .map(|p| p.relative_path)
                        .collect(),
                };

                (package.relative_path, details)
            })
            .collect();

        Ok(map)
    }