rust

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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(_ context.Context, bumps []scan.SecurityBump, deps *ecosystem.ModuleDeps) map[string]scan.SecurityBump

BumpCoords maps each OSV bump to its rendered-grammar coordinate (see ecosystem.SplitDep): the crate name for a crate locked at one version, "crate@locked" for one locked at several, matching the pinned entries FilterBumps renders for it.

func (*Ecosystem) FilterBumps

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

FilterBumps merges existing entries and candidate bumps per crate and Cargo semver line, keeping the highest version in each line (an existing entry is never lowered). A pinned entry "crate@from=to" belongs to the line of from, a bump to the line of its CurrentVersion. An entry is dropped when no locked version shares its line, or when the highest locked version in that line is already at or above it, so a stale pin never downgrades. A fix that is not a Cargo-compatible upgrade of its 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) is held back, never written. A crate locked at one version renders as "crate@version"; one locked at several renders one "crate@<locked>=version" per line, since omnibump keys plain entries by crate name and a second would overwrite the first. Omnibump's own per-line constraint resolution is not replicated.

ponytail: two locked versions in the same semver line (Cargo normally merges them) share one entry, pinned from the highest; split by exact locked version if that ever shows up in a real Cargo.lock.

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