semver

Rust parser and evaluator for Cargo's flavor of Semantic Versioning

Library
Cargo
v1.0.28
673stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
54/100Fair
Development Activity32
Maintenance28
Community76
Maturity60
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
78/100Good
Architecture80
Code Quality85
Innovation60
Learning Curve85

The semver crate is the reference Rust implementation for parsing and evaluating Semantic Versioning strings and version requirements, matching Cargo’s own interpretation of the SemVer spec. It exposes Version and VersionReq types that parse strings like 1.2.3-alpha.1+build5 and requirement expressions like >=1.2.3, <1.8.0, then evaluate whether a given version satisfies a requirement.

Written and maintained by David Tolnay, this is the same crate Cargo itself uses internally for dependency resolution, making it the de facto standard for any Rust tool that needs to work with version numbers or version constraints in a way that’s compatible with the crates.io ecosystem.

What You Get

  • Version and VersionReq types with parse() methods for version strings and requirement expressions
  • Full support for pre-release and build-metadata identifiers per the SemVer 2.0 spec
  • Comparison and ordering implementations (Ord, PartialOrd) for Version following SemVer precedence rules
  • Optional serde feature for serializing/deserializing versions and requirements
  • no_std compatibility via the default-toggleable std feature

Common Use Cases

  • Parsing and validating version numbers supplied by users, config files, or package manifests
  • Implementing dependency resolution or compatibility checks that need to evaluate whether an installed version satisfies a stated requirement
  • Building Cargo-adjacent tooling (linters, dependency auditors, build scripts) that needs to interpret Cargo.toml version requirements identically to Cargo itself
  • Embedding version-aware feature gating or migration logic in libraries and CLIs

Under The Hood

Architecture The crate is organized into focused modules under src/: parse.rs handles the recursive-descent parsing of both Version and VersionReq grammars, eval.rs implements the requirement-matching logic (checking a Version against a VersionReq’s comparator list), identifier.rs provides a specialized small-string type for pre-release/build-metadata identifiers to avoid heap allocation in the common case, display.rs implements Display/Debug formatting, and impls.rs/serde.rs add trait implementations (Ord, Hash, optional serde::Serialize/Deserialize). lib.rs (569 lines) defines the core Version/VersionReq/Comparator/Prerelease/BuildMetadata types and re-exports the public API.

Tech Stack Pure Rust with edition 2021, zero required dependencies, and an optional serde_core dependency gated behind the serde feature; the crate supports no_std environments by default-toggling the std feature off. A build.rs script and criterion-based benchmarks (benches/parse.rs) track parsing performance, and a fuzz/ directory holds cargo-fuzz targets for the parser, reflecting the correctness-critical nature of version parsing for the wider Cargo ecosystem.

Code Quality The crate has a dedicated tests/ directory alongside fuzz targets specifically exercising the parser against malformed input, an important quality bar given that this crate underpins Cargo’s own dependency resolution. Code is organized into small, single-responsibility modules (identifier.rs at 412 lines is the largest besides lib.rs), and the specialized Identifier type in identifier.rs shows deliberate attention to avoiding unnecessary allocations in a hot-path parsing library.

API Design The public API is small and idiomatic: Version::parse(&str) and VersionReq::parse(&str) return Result types, and VersionReq::matches(&Version) is the primary evaluation entry point, requiring no configuration to get started. Because it mirrors Cargo’s own internal version-handling exactly, the API surface is intentionally unsurprising to any Rust developer already familiar with how Cargo.toml dependency version constraints behave.

Used by 13 apps in this directory

TypeScript
51%
MIT

Anarlog

Note Taking · AI Assistants · Productivity

9,087

Anarlog is an open-source, local-first AI meeting notetaker that records, transcribes, and summarizes meetings entirely on your device — no cloud lock-in, no mandatory account, and every note saved as a plain markdown file you own forever.

View details
86
Repo Health
77
Technical
69
Dependency
Built with
TypeScript51%
Rust38%
Updated today
Dart
74%
AGPL 3.0

AppFlowy

Productivity · Project Management · Collaboration

75,729

The open-source AI workspace that puts your data, your rules — with local LLMs, CRDT collaboration, and full self-hosting built in.

View details
66
Repo Health
81
Technical
66
Dependency
Built with
Dart74%
Rust24%
Updated 1 weeks ago
TypeScript
55%
Other

Cap

Team Chat · Video Conferencing

20,986

Open source Loom alternative with GPU-accelerated recording, instant share links, AI summaries, and full self-hosting via Docker Compose.

View details
89
Repo Health
81
Technical
65
Dependency
Built with
TypeScript55%
Rust40%
Updated yesterday
Rust
89%
Apache 2.0

Graphite

Code Editors · Design Tools

26,876

A free, open source procedural 2D design tool that unifies vector, raster, motion graphics, and generative art in a single node-based nondestructive workflow.

View details
84
Repo Health
77
Technical
70
Dependency
Built with
Rust89%
Updated today
TypeScript
67%
MIT

Hoppscotch

Developer Tools

80,055

A lightweight, offline-capable API development ecosystem for testing HTTP, GraphQL, WebSocket, MQTT, and SSE endpoints across web, desktop, and CLI.

View details
91
Repo Health
83
Technical
66
Dependency
Built with
TypeScript67%
Vue23%
Updated 3 days ago
Rust
72%
Other

iii

Developer Tools · Devops

18,604

Compose, extend, and observe every backend service in real time using three primitives: Workers, Functions, and Triggers.

View details
86
Repo Health
85
Technical
69
Dependency
Built with
Rust72%
TypeScript17%
Updated yesterday
Rust
78%
AGPL 3.0

Lemmy

Community · Social Media

14,555

Federated, self-hosted Reddit alternative with full community ownership and no corporate control.

View details
90
Repo Health
74
Technical
63
Dependency
Built with
Rust78%
PLpgSQL14%
Updated yesterday
JavaScript
57%
Other

Lokus

Note Taking · Knowledge Management

774

Local-first note-taking with graph view, canvas & AI plugins—your Markdown files, zero telemetry, blazing-fast Rust performance.

View details
78
Repo Health
75
Technical
65
Dependency
Built with
JavaScript57%
HTML24%
Updated 1 weeks ago
Rust
100%
Other

Meilisearch

Search

59,012

Lightning-fast hybrid search engine with AI-powered semantic and full-text retrieval for modern applications.

View details
90
Repo Health
88
Technical
68
Dependency
Built with
Rust100%
Updated 5 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search