rust

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 11 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

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, []ecosystem.HeldBump)

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. An existing entry above an advisory's fix is kept (never lowered). A fix is held back, never written, when the crate is locked at several versions (one entry cannot say which to move) or when it is not a Cargo-compatible upgrade of the locked version (a different major, or for 0.x a different minor: 0.12 -> 0.14 is a breaking change under Cargo's caret rules, which Cargo.toml requirements - not fetched here - would refuse). Omnibump's own per-line constraint resolution is not replicated.

func (*Ecosystem) ManifestFiles

func (e *Ecosystem) ManifestFiles() (required, optional []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(_ context.Context, deps *ecosystem.ModuleDeps) []scan.Package

Jump to

Keyboard shortcuts

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