avm_server/
lib.rs

1/*
2 * AquaVM Workflow Engine
3 *
4 * Copyright (C) 2024 Fluence DAO
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as
8 * published by the Free Software Foundation version 3 of the
9 * License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU Affero General Public License for more details.
15 *
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
18 */
19#![warn(rust_2018_idioms)]
20#![deny(
21    dead_code,
22    nonstandard_style,
23    unused_imports,
24    unused_mut,
25    unused_variables,
26    unused_unsafe,
27    unreachable_patterns
28)]
29
30mod avm;
31mod config;
32mod errors;
33mod runner;
34
35pub use avm::AVM;
36pub use config::AVMConfig;
37pub use errors::AVMError;
38pub use runner::AVMMemoryStats;
39pub use runner::AVMRuntimeLimits;
40pub use runner::AquaVMRuntimeLimits;
41
42pub use avm_interface::*;
43
44pub mod avm_runner {
45    pub use crate::runner::AVMRunner;
46    pub use avm_interface::raw_outcome::RawAVMOutcome;
47}
48
49// Re-exports
50pub use marine::ne_vec;
51pub use marine::HostExportedFunc;
52pub use marine::HostImportDescriptor;
53pub use marine::HostImportError;
54pub use marine::IType;
55pub use marine::IValue;
56
57pub use polyplets::SecurityTetraplet;
58
59pub use avm_data_store::AnomalyData;
60pub use avm_data_store::DataStore;
61
62pub type AVMDataStore<E> = Box<dyn DataStore<Error = E> + Send + Sync + 'static>;
63
64pub type AVMResult<T, E> = std::result::Result<T, AVMError<E>>;
65
66pub use errors::RunnerError;
67pub type RunnerResult<T> = std::result::Result<T, RunnerError>;