packageurl
Read and generate Package URLs in Rust.
About
This crate is an implementation of the Package URL specification for the Rust programming language.
Usage
Add this crate to the Cargo.toml
:
[]
= "^0.1.0"
Parse a string containing a raw PURL using the
FromStr
trait:
extern crate packageurl
use FromStr;
use PackageUrl;
let purl = from_str
Generate a canonical PURL using the
ToString
trait:
extern crate packageurl;
use ToString;
use PackageUrl;
let canonical = new
.with_version
.to_string;
See more in the online documentation.
Note
The specification is not completely enforced right now: in particular, it will allow building Package URLs with invalid namespaces and the like. More validations and errors are to be added in the future.