跳到主要内容
本页尚未翻译

下面显示的是英文原文。

License

License names the license the service is published under, with an optional URL of its text.

AppInfo::license sets it. License::new takes the name, an SPDX identifier by convention. url points at the license text. The example runs with cargo test --example asyncapi_info --no-default-features --features asyncapi.

Example​

/// The license, by its SPDX identifier and where its text is.
fn license() -> License {
License::new("Apache-2.0").url("https://spdx.org/licenses/Apache-2.0.html")
}