rust

package
v0.1.95 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package rust implements the scanner.Adapter for the "cargo" ecosystem. Lockfile and manifest are regex-parsed (no TOML dependency); symbols come from `use`/`extern crate` statements only — macro invocations are never attributed (goal.md §13.5, conservative).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct{}

Adapter implements scanner.Adapter for Cargo projects.

func New

func New() *Adapter

New returns the cargo ecosystem adapter.

func (*Adapter) Capabilities

func (*Adapter) Capabilities() []string

func (*Adapter) ClassifyCommand

func (*Adapter) ClassifyCommand(argv []string) scanner.CommandProfile

func (*Adapter) Detect

func (*Adapter) Detect(dir string) bool

func (*Adapter) Ecosystem

func (*Adapter) Ecosystem() string

func (*Adapter) EnvironmentHints

func (*Adapter) EnvironmentHints(ctx context.Context, dir string) map[string]string

func (Adapter) ScanEdges added in v0.1.40

func (Adapter) ScanEdges(_ context.Context, dir string) ([]scanner.Edge, error)

ScanEdges reports the dependency tree from Cargo.lock.

The tree was already in the file and nothing read it. The network held 1,351 dependency edges and every one of them was npm, because adapters/node was the only adapter implementing EdgeScanner — so "which package pulled this version of that library" had no answer for cargo, pypi or golang.

Publicness is not decided here. Every edge is returned and the caller drops the ones whose ends are not public, the same way it does for packages: deciding it twice in two places is how the two answers drift apart.

func (*Adapter) ScanPackages

func (*Adapter) ScanPackages(ctx context.Context, dir string) ([]scanner.ResolvedPackage, error)

func (*Adapter) ScanSymbols

func (*Adapter) ScanSymbols(ctx context.Context, dir string, pkgs []scanner.ResolvedPackage) ([]scanner.SymbolUsage, error)

ScanSymbols regex-scans src/**/*.rs and tests/**/*.rs for `use` and `extern crate` statements whose first path segment matches a dependency crate ident ('-' normalized to '_'). Leaf items become PROBABLE families like "serde::Deserialize"; bare/glob/self/extern-crate uses become package-level UNKNOWN. Macro invocations (#[derive(Serialize)]) are never attributed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL