pub struct RegistryMetadata {
pub authors: Option<Vec<String>>,
pub description: Option<String>,
pub license: Option<String>,
pub custom_licenses: Option<Vec<CustomLicense>>,
pub links: Option<Vec<Link>>,
pub categories: Option<Vec<String>>,
}
Expand description
Metadata used by a Warg registry
Fields§
List of authors who has created this package.
description: Option<String>
Package description in markdown format.
license: Option<String>
SPDX License Expression https://spdx.github.io/spdx-spec/v2.3/SPDX-license-expressions/ SPDX License List: https://spdx.org/licenses/
custom_licenses: Option<Vec<CustomLicense>>
A list of custom licenses that should be referenced to from the license expression. https://spdx.github.io/spdx-spec/v2.3/other-licensing-information-detected/
links: Option<Vec<Link>>
A list of links that can contain predefined link types or custom links for use with tooling or registries.
categories: Option<Vec<String>>
A list of categories that a package should be listed under when uploaded to a registry.
Implementations§
Source§impl RegistryMetadata
impl RegistryMetadata
Sourcepub fn add_to_wasm(&self, input: &[u8]) -> Result<Vec<u8>>
pub fn add_to_wasm(&self, input: &[u8]) -> Result<Vec<u8>>
Merge into an existing wasm module. Rewrites the module with this registry-metadata section overwriting its existing one, or adds this registry-metadata section if none is present.
Sourcepub fn from_wasm(bytes: &[u8]) -> Result<Option<Self>>
pub fn from_wasm(bytes: &[u8]) -> Result<Option<Self>>
Parse a Wasm binary and extract the Registry
section, if there is any.
Sourcepub fn from_bytes(bytes: &[u8], offset: usize) -> Result<Self>
pub fn from_bytes(bytes: &[u8], offset: usize) -> Result<Self>
Gets the registry-matadata from a slice of bytes
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Validate the RegistryMetadata::license
an
RegistryMetadata::CustomLicense
are valid SPDX expressions.
Get authors
Set authors
Sourcepub fn get_description(&self) -> Option<&String>
pub fn get_description(&self) -> Option<&String>
Get description
Sourcepub fn set_description(&mut self, description: Option<String>)
pub fn set_description(&mut self, description: Option<String>)
Set description
Sourcepub fn get_license(&self) -> Option<&String>
pub fn get_license(&self) -> Option<&String>
Get license
Sourcepub fn set_license(&mut self, license: Option<String>)
pub fn set_license(&mut self, license: Option<String>)
Set license
Sourcepub fn get_custom_licenses(&self) -> Option<&Vec<CustomLicense>>
pub fn get_custom_licenses(&self) -> Option<&Vec<CustomLicense>>
Get custom_licenses
Sourcepub fn set_custom_licenses(
&mut self,
custom_licenses: Option<Vec<CustomLicense>>,
)
pub fn set_custom_licenses( &mut self, custom_licenses: Option<Vec<CustomLicense>>, )
Set custom_licenses
Sourcepub fn get_categories(&self) -> Option<&Vec<String>>
pub fn get_categories(&self) -> Option<&Vec<String>>
Get categories
Sourcepub fn set_categories(&mut self, categories: Option<Vec<String>>)
pub fn set_categories(&mut self, categories: Option<Vec<String>>)
Set categories
Trait Implementations§
Source§impl Clone for RegistryMetadata
impl Clone for RegistryMetadata
Source§fn clone(&self) -> RegistryMetadata
fn clone(&self) -> RegistryMetadata
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more