pub fn metadata_by_summary_id(&self, summary_id: &SummaryId) -> Result<PackageMetadata, Error> {
        match &summary_id.source {
            SummarySource::Workspace { workspace_path } => {
                self.workspace().member_by_path(workspace_path)
            }
            _ => {
                // Do a linear search for now -- this appears to be the easiest thing to do and is
                // pretty fast. This could potentially be sped up by building an index by name, but
                // at least for reasonably-sized graphs it's really fast.
                //
                // TODO: consider optimizing this in the future.
                let mut filter = self.packages().filter(|package| {
                    package.name() == summary_id.name
                        && package.version() == &summary_id.version
                        && package.source() == summary_id.source
                });
                filter
                    .next()
                    .ok_or_else(|| Error::UnknownSummaryId(summary_id.clone()))
            }
        }
    }
Converts this `SummaryId` to a `PackageMetadata`.

Returns an error if the summary ID could not be matched.

Requires the `summaries` feature to be enabled.
guppy/src/graph/summaries.rs