rust

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package rust implements the Rust/Cargo ecosystem.Ecosystem, backed by omnibump's RustAnalyzer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ecosystem

type Ecosystem struct {
	// contains filtered or unexported fields
}

Ecosystem implements ecosystem.Ecosystem for Rust/Cargo projects. omnibump's RustAnalyzer has no checkout-free AnalyzeRemote, so Analyze materializes the fetched Cargo.lock into a real temp directory (via ecosystem.WriteTempFiles) and calls the local Analyze against it.

func New

func New() *Ecosystem

New creates the Rust ecosystem implementation.

func (*Ecosystem) Analyze

func (e *Ecosystem) Analyze(ctx context.Context, files map[string][]byte) (*ecosystem.ModuleDeps, error)

func (*Ecosystem) BumpCoords

func (e *Ecosystem) BumpCoords(bumps []scan.SecurityBump, _ *ecosystem.ModuleDeps) map[string]scan.SecurityBump

BumpCoords maps each OSV bump to its rendered-grammar coordinate. For Rust the two coincide: OSV names crates exactly as Cargo.lock does, and the rendered grammar is "crate@version", so the coordinate is the crate name.

func (*Ecosystem) FilterBumps

func (e *Ecosystem) FilterBumps(_ context.Context, existing []string, bumps []scan.SecurityBump, deps *ecosystem.ModuleDeps) []string

FilterBumps keeps a candidate bump only when the crate is present in this modroot's Cargo.lock and the candidate version is newer than the highest locked version (Cargo.lock may pin a crate at multiple versions across the dependency graph). This does not replicate omnibump's own per-line semver-constraint resolution (that requires parsing Cargo.toml's caret requirements, which CHOAM doesn't fetch) - it's a simpler "is this newer than what's locked" check, sufficient to decide whether a bump applies.

func (*Ecosystem) ManifestFiles

func (e *Ecosystem) ManifestFiles() []string

ManifestFiles returns Cargo.lock only: omnibump's RustAnalyzer.Analyze reads Cargo.lock exclusively and never consults Cargo.toml.

func (*Ecosystem) Name

func (e *Ecosystem) Name() string

func (*Ecosystem) ScanPackages

func (e *Ecosystem) ScanPackages(deps *ecosystem.ModuleDeps) []scan.Package

Jump to

Keyboard shortcuts

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