Skip to main content

Crate notalawyer

Crate notalawyer 

Source
Expand description

Embed and access the license notices of a crate’s dependencies.

notalawyer is the runtime core of a three-crate family that lets a binary display the license notices of every crate it depends on:

  • notalawyer-build runs from a build.rs, gathers the dependency licenses, and writes a NOTICE file into OUT_DIR.
  • notalawyer (this crate) provides the include_notice! macro, which embeds that generated NOTICE file into the binary as a &'static str.
  • notalawyer-clap wires the notice into a clap CLI behind a --license-notice flag.

This crate has no dependencies and exposes only the include_notice! macro.

§Example

// The build script (notalawyer-build) wrote a NOTICE file into OUT_DIR.
// `include_notice!` embeds it as a `&'static str` at compile time.
let notice: &'static str = notalawyer::include_notice!();
print!("{notice}");

Macros§

include_notice
Embed the generated dependency-license NOTICE file as a &'static str.