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§

collectmacros
Collect licensing information at build-time.

Structs§

CollectConfig
Configuration options for the collection process.
Crate
Information about a crate.
Licensing
Licensing information returned by collect.

Enums§

CollectPlatform
CrateLicense
Represents the license of a Crate.
Error
Error type.

Functions§

collect
Collect licensing information at runtime.
collect_from_manifest
Collect licensing information from given manifest path.