Skip to main content

License

Trait License 

Source
pub trait License {
    // Required method
    fn license(&self) -> Option<String>;
}
Expand description

Programmatic access to a declared license, from either a parsed package.json (PackageJson) or a parsed lockfile entry (lock::LockedPackage). Lets a consumer source a package’s license from whichever it has — the lockfile when it records one, the manifest otherwise.

Required Methods§

Source

fn license(&self) -> Option<String>

The declared SPDX-ish license string, if any.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§