Crate embed_licensing

source ·
Expand description

Proc-macro for embedding licensing information about a crate.

It also exposes its internal functions that allow either collecting licensing information at runtime (with collect()), when in the directory of the manifest, or collecting licensing information from a specific manifest file (with collect_from_manifest).

However, the recommended way to use this crate is the macro collect!:

let licensing = embed_licensing::collect!();

for package in licensing.packages {
    if let embed_licensing::CrateLicense::SpdxExpression(expr) = package.license {
        println!("{} {} ({})", package.name, package.version, expr);
    } else {
        println!("{} {} uses custom license", package.name, package.version);
    }
}

Macros§

  • Collect licensing information at build-time.

Structs§

Enums§

Functions§