{"id":19016192,"url":"https://github.com/fosskers/rs-versions","last_synced_at":"2025-10-27T00:48:29.297Z","repository":{"id":43372401,"uuid":"268693466","full_name":"fosskers/rs-versions","owner":"fosskers","description":"A library for parsing and comparing software version numbers.","archived":false,"fork":false,"pushed_at":"2025-02-24T06:38:20.000Z","size":217,"stargazers_count":26,"open_issues_count":3,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T16:11:10.939Z","etag":null,"topics":["rust","versioning"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/versions","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fosskers.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"fosskers","custom":"https://www.buymeacoffee.com/fosskers"}},"created_at":"2020-06-02T03:37:55.000Z","updated_at":"2025-02-24T06:37:40.000Z","dependencies_parsed_at":"2023-12-06T02:59:00.732Z","dependency_job_id":"7e9116e6-d50a-4cbd-9126-4b9d58d842ea","html_url":"https://github.com/fosskers/rs-versions","commit_stats":{"total_commits":97,"total_committers":5,"mean_commits":19.4,"dds":0.09278350515463918,"last_synced_commit":"d75ff8fbf3aad65c36bf83e912e3a929f0d7d6b2"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fosskers%2Frs-versions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fosskers%2Frs-versions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fosskers%2Frs-versions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fosskers%2Frs-versions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fosskers","download_url":"https://codeload.github.com/fosskers/rs-versions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247217221,"owners_count":20903009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rust","versioning"],"created_at":"2024-11-08T19:41:34.653Z","updated_at":"2025-10-27T00:48:29.235Z","avatar_url":"https://github.com/fosskers.png","language":"Rust","funding_links":["https://github.com/sponsors/fosskers","https://www.buymeacoffee.com/fosskers"],"categories":[],"sub_categories":[],"readme":"# Versions\n\n[![Tests](https://github.com/fosskers/rs-versions/workflows/Tests/badge.svg)](https://github.com/fosskers/rs-versions/actions)\n[![](https://img.shields.io/crates/v/versions.svg)](https://crates.io/crates/versions)\n\n\u003c!-- cargo-rdme start --\u003e\n\nA library for parsing and comparing software version numbers.\n\nWe like to give version numbers to our software in a myriad of different\nways. Some ways follow strict guidelines for incrementing and comparison.\nSome follow conventional wisdom and are generally self-consistent. Some are\njust plain asinine. This library provides a means of parsing and comparing\n*any* style of versioning, be it a nice Semantic Version like this:\n\n\u003e 1.2.3-r1\n\n...or a monstrosity like this:\n\n\u003e 2:10.2+0.0093r3+1-1\n\n## Usage\n\nIf you're parsing several version numbers that don't follow a single scheme\n(say, as in system packages), then use the [`Versioning`] type and its\nparser [`Versioning::new`]. Otherwise, each main type - [`SemVer`],\n[`Version`], or [`Mess`] - can be parsed on their own via the `new` method\n(e.g. [`SemVer::new`]).\n\n## Examples\n\n```rust\nuse versions::Versioning;\n\nlet good = Versioning::new(\"1.6.0\").unwrap();\nlet evil = Versioning::new(\"1.6.0a+2014+m872b87e73dfb-1\").unwrap();\n\nassert!(good.is_ideal());   // It parsed as a `SemVer`.\nassert!(evil.is_complex()); // It parsed as a `Mess`.\nassert!(good \u003e evil);       // We can compare them anyway!\n```\n\n## Version Constraints\n\nTools like `cargo` also allow version constraints to be prepended to a\nversion number, like in `^1.2.3`.\n\n```rust\nuse versions::{Requirement, Versioning};\n\nlet req = Requirement::new(\"^1.2.3\").unwrap();\nlet ver = Versioning::new(\"1.2.4\").unwrap();\nassert!(req.matches(\u0026ver));\n```\n\nIn this case, the incoming version `1.2.4` satisfies the \"caret\" constraint,\nwhich demands anything greater than or equal to `1.2.3`.\n\nSee the [`Requirement`] type for more details.\n\n## Usage with `nom`\n\nIn constructing your own [`nom`](https://lib.rs/nom) parsers, you can\nintegrate the parsers used for the types in this crate via\n[`Versioning::parse`], [`SemVer::parse`], [`Version::parse`], and\n[`Mess::parse`].\n\n## Features\n\nYou can enable [`Serde`](https://serde.rs/) support for serialization and\ndeserialization with the `serde` feature.\n\nBy default the version structs are serialized/deserialized as-is. If instead\nyou'd like to deserialize directly from a raw version string like `1.2.3`,\nsee [`Versioning::deserialize_pretty`].\n\n\u003c!-- cargo-rdme end --\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffosskers%2Frs-versions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffosskers%2Frs-versions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffosskers%2Frs-versions/lists"}