wasmer_config/
cargo_annotations.rs

1//! Rust and cargo specific annotations used to interoperate with external tools.
2
3use std::path::PathBuf;
4
5use indexmap::IndexMap;
6
7use crate::package::{Abi, Bindings};
8
9/// The annotation used by `cargo wapm` when it parses the
10/// `[package.metadata.wapm]` table in your `Cargo.toml`.
11#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
12#[serde(rename_all = "kebab-case")]
13pub struct CargoWasmerPackageAnnotation {
14    /// The namespace this package should be published under.
15    pub namespace: String,
16    /// The name the package should be published under, if it differs from the
17    /// crate name.
18    pub package: Option<String>,
19    /// Extra flags that should be passed to the `wasmer` CLI.
20    pub wasmer_extra_flags: Option<String>,
21    /// The ABI to use when adding the compiled crate to the package.
22    pub abi: Abi,
23    /// Filesystem mappings.
24    #[serde(default, skip_serializing_if = "Option::is_none")]
25    pub fs: Option<IndexMap<String, PathBuf>>,
26    /// Binding declarations for the crate.
27    pub bindings: Option<Bindings>,
28}