1 | use serde_derive::Serialize; |
2 | use std::ops::Range; |
3 | |
4 | use crate::{Author, Description, Homepage, Licenses, Producers, Revision, Source, Version}; |
5 | |
6 | /// Metadata associated with a Wasm Component or Module |
7 | #[derive (Debug, Serialize, Default)] |
8 | #[serde(rename_all = "lowercase" )] |
9 | pub struct Metadata { |
10 | /// The component name, if any. Found in the component-name section. |
11 | pub name: Option<String>, |
12 | /// The component's producers section, if any. |
13 | pub producers: Option<Producers>, |
14 | /// The component's author section, if any. |
15 | pub author: Option<Author>, |
16 | /// Human-readable description of the binary |
17 | pub description: Option<Description>, |
18 | /// License(s) under which contained software is distributed as an SPDX License Expression. |
19 | pub licenses: Option<Licenses>, |
20 | /// URL to get source code for building the image |
21 | pub source: Option<Source>, |
22 | /// URL to find more information on the binary |
23 | pub homepage: Option<Homepage>, |
24 | /// Source control revision identifier for the packaged software. |
25 | pub revision: Option<Revision>, |
26 | /// Version of the packaged software |
27 | pub version: Option<Version>, |
28 | /// Byte range of the module in the parent binary |
29 | pub range: Range<usize>, |
30 | } |
31 | |