wasm_metadata/
metadata.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use serde_derive::Serialize;
use std::ops::Range;

use crate::{Author, Description, Homepage, Licenses, Producers, Revision, Source, Version};

/// Metadata associated with a Wasm Component or Module
#[derive(Debug, Serialize, Default)]
#[serde(rename_all = "lowercase")]
pub struct Metadata {
    /// The component name, if any. Found in the component-name section.
    pub name: Option<String>,
    /// The component's producers section, if any.
    pub producers: Option<Producers>,
    /// The component's author section, if any.
    pub author: Option<Author>,
    /// Human-readable description of the binary
    pub description: Option<Description>,
    /// License(s) under which contained software is distributed as an SPDX License Expression.
    pub licenses: Option<Licenses>,
    /// URL to get source code for building the image
    pub source: Option<Source>,
    /// URL to find more information on the binary
    pub homepage: Option<Homepage>,
    /// Source control revision identifier for the packaged software.
    pub revision: Option<Revision>,
    /// Version of the packaged software
    pub version: Option<Version>,
    /// Byte range of the module in the parent binary
    pub range: Range<usize>,
}