wasefire_applet_api/
lib.rs

1// Copyright 2022 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#![cfg_attr(feature = "host", doc = "Platform-side of the applet API.")]
16#![cfg_attr(feature = "wasm", doc = include_str!("wasm.md"))]
17#![cfg_attr(feature = "wasm", doc = "\n## WebAssembly-level documentation\n")]
18#![cfg_attr(feature = "wasm", doc = include_str!("api.md"))]
19#![no_std]
20#![cfg_attr(all(feature = "wasm", feature = "native"), feature(linkage))]
21#![cfg_attr(feature = "host", feature(never_type))]
22#![feature(doc_auto_cfg)]
23
24extern crate alloc;
25
26#[cfg(feature = "host")]
27pub use host::*;
28use wasefire_error as _;
29use wasefire_one_of::exactly_one_of;
30
31#[cfg(feature = "host")]
32mod host;
33#[cfg(feature = "wasm")]
34pub(crate) mod wasm;
35
36exactly_one_of!["host", "wasm"];
37
38#[cfg(feature = "wasm")]
39wasefire_applet_api_macro::wasm!();
40
41#[cfg(feature = "host")]
42wasefire_applet_api_macro::host!();