license
SPDX license identifiers and expressions: look a license up, parse MIT OR Apache-2.0, check it
against a policy, write a source header.
lookup gives the name and family (Category) of about forty common licenses, normalize
updates the deprecated GNU identifiers, Expression parses and evaluates SPDX expressions, and
header writes the copyright and SPDX-License-Identifier lines. This is information for tooling,
not legal advice.
Install
Section titled “Install”Cargo feature license (enabled by default). To compile only this module:
or in Cargo.toml:
Import path: helpers4::license.
| Item | What it does |
|---|---|
Category | How a license treats the code that uses it: the main families, from most to least permissive. |
Expression | An SPDX license expression: one license, or several combined with AND and OR. |
header | The two-line source header that carries a copyright notice and an SPDX license identifier. |
LicenseInfo | What is known about one license: its SPDX identifier, its name and its family. |
lookup | What this module knows about the license with SPDX identifier id. |
normalize | The current SPDX identifier for a deprecated one. |
Error types
Section titled “Error types”Documented on the page of the helper that returns them.
| Type | Returned by |
|---|---|
ParseExpressionError | Expression |
