opa_wasm/
lib.rs

1// Copyright 2022-2024 The Matrix.org Foundation C.I.C.
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#![doc = include_str!("../README.md")]
16#![deny(
17    missing_docs,
18    clippy::all,
19    clippy::pedantic,
20    clippy::missing_docs_in_private_items,
21    clippy::panic, // Disallow panics
22    clippy::print_stderr, // Disallow directly writing to stderr. Use tracing instead
23    clippy::print_stdout, // Disallow directly writing to stdout. Use tracing instead
24    clippy::unwrap_used, // Disallow the use of Result::{unwrap,expect}. Propagate errors instaed
25    clippy::unwrap_in_result,
26    clippy::expect_used,
27)]
28#![allow(clippy::blocks_in_conditions)]
29
30mod builtins;
31mod context;
32mod funcs;
33#[cfg(feature = "loader")]
34mod loader;
35mod policy;
36mod types;
37
38// Re-export wasmtime to make it easier to keep the verisons in sync
39pub use wasmtime;
40
41#[cfg(feature = "loader")]
42pub use self::loader::{load_bundle, read_bundle};
43pub use self::{
44    context::{tests::TestContext, DefaultContext, EvaluationContext},
45    policy::{Policy, Runtime},
46    types::AbiVersion,
47};