1#[cfg(test)]
4mod tests;
5
6#[macro_use]
7mod macros;
8
9mod steps_between;
10use self::steps_between::StepsBetween;
11
12mod hint;
13pub(crate) use self::hint::hint_capacity;
14
15mod dynamic;
16pub use self::dynamic::{DynamicEmpty, DynamicStruct, DynamicTuple};
17
18mod access;
19pub use self::access::AccessError;
20pub(crate) use self::access::{Access, RawAccessGuard, Snapshot};
21
22mod borrow_mut;
23pub use self::borrow_mut::BorrowMut;
24
25mod borrow_ref;
26pub use self::borrow_ref::BorrowRef;
27
28mod any_obj_vtable;
29use self::any_obj_vtable::AnyObjVtable;
30
31mod any_obj;
32pub use self::any_obj::{AnyObj, AnyObjError};
33use self::any_obj::{AnyObjData, AnyObjErrorKind};
34pub(crate) use self::any_obj::{AnyObjDrop, RawAnyObjGuard};
35
36mod shared;
37pub use self::shared::Shared;
38
39mod args;
40pub use self::args::{Args, FixedArgs};
41pub(crate) use self::args::{DynArgs, DynArgsUsed, DynGuardedArgs};
42
43mod awaited;
44pub(crate) use self::awaited::Awaited;
45
46pub mod budget;
47
48mod bytes;
49pub use self::bytes::{bytes_slice_index_get, Bytes};
50
51mod call;
52pub use self::call::Call;
53
54mod const_value;
55#[doc(hidden)]
56pub use self::const_value::ToConstValue;
57pub use self::const_value::{
58 from_const_value, to_const_value, ConstConstruct, ConstConstructImpl, ConstFields,
59 ConstFieldsIter, ConstValue, ConstValueBuf, FromConstValue,
60};
61pub(crate) use self::const_value::{
62 ConstContext, ConstNodeKind, EmptyConstContext, MAX_CONST_DEPTH,
63};
64
65pub mod debug;
66pub use self::debug::{DebugGlobal, DebugInfo, DebugInst};
67
68mod env;
69
70pub mod format;
71pub use self::format::{Format, FormatSpec};
72
73mod from_value;
74pub use self::from_value::{from_value, FromValue, UnsafeToMut, UnsafeToRef};
75
76mod function;
77pub use self::function::{Function, SyncFunction};
78
79mod future;
80pub use self::future::Future;
81pub(crate) use self::future::SelectFuture;
82
83mod globals;
84pub use self::globals::{Globals, GlobalsError};
85
86pub(crate) mod generator;
87pub use self::generator::Generator;
88
89mod generator_state;
90pub use self::generator_state::GeneratorState;
91
92mod guarded_args;
93pub use self::guarded_args::GuardedArgs;
94
95pub(crate) mod into_output;
96pub use self::into_output::IntoOutput;
97
98pub(crate) mod inst;
99pub use self::inst::{Address, Inst, Output};
100pub(crate) use self::inst::{
101 InstArithmeticOp, InstBitwiseOp, InstOp, InstRange, InstShiftOp, InstTarget, InstValue,
102 PanicReason,
103};
104
105mod iterator;
106pub use self::iterator::Iterator;
107
108mod r#type;
109pub use self::r#type::Type;
110
111mod label;
112pub use self::label::DebugLabel;
113pub(crate) use self::label::Label;
114
115pub(crate) mod object;
116pub use self::object::Object;
117
118mod panic;
119pub(crate) use self::panic::{BoxedPanic, Panic};
120
121mod protocol;
122pub use self::protocol::Protocol;
123
124mod protocol_caller;
125pub(crate) use self::protocol_caller::{EnvProtocolCaller, ProtocolCaller};
126
127pub(crate) mod range_from;
128pub use self::range_from::RangeFrom;
129
130mod range_full;
131pub use self::range_full::RangeFull;
132
133mod range_to_inclusive;
134pub use self::range_to_inclusive::RangeToInclusive;
135
136mod range_to;
137pub use self::range_to::RangeTo;
138
139pub(crate) mod range_inclusive;
140pub use self::range_inclusive::RangeInclusive;
141
142pub(crate) mod range;
143pub use self::range::Range;
144
145mod runtime_context;
146pub use self::runtime_context::RuntimeContext;
147
148mod select;
149pub(crate) use self::select::Select;
150
151mod r#ref;
152use self::r#ref::RefVtable;
153pub use self::r#ref::{Mut, RawAnyGuard, Ref};
154
155mod memory;
156pub use self::memory::{Memory, SliceError, Stack, StackError, StoreError};
157pub(crate) use self::memory::{Pair, StoreErrorKind};
158
159mod static_string;
160pub use self::static_string::StaticString;
161
162mod stream;
163pub use self::stream::Stream;
164
165mod to_value;
166#[doc(hidden)]
167pub use self::to_value::ToValue;
168pub use self::to_value::{to_value, IntoReturn, UnsafeToValue};
169
170mod tuple;
171pub use self::tuple::{OwnedTuple, Tuple};
172
173mod type_info;
174pub use self::type_info::{AnyTypeInfo, TypeInfo};
175
176mod type_of;
177pub use self::type_of::{MaybeTypeOf, TypeHash, TypeOf};
178
179pub mod unit;
180pub(crate) use self::unit::UnitFn;
181pub use self::unit::{Unit, UnitStorage};
182
183mod value;
184pub use self::value::{
185 Accessor, Dismantle, EmptyStruct, Handover, Inline, RawValueGuard, Rtti, Struct, TupleStruct,
186 TypeValue, Value, ValueMutGuard, ValueRefGuard,
187};
188pub(crate) use self::value::{AnySequence, AnySequenceTakeError, Repr, RttiKind, Worklist};
189
190pub mod slice;
191
192mod vec;
193pub use self::vec::Vec;
194
195mod vec_tuple;
196pub use self::vec_tuple::VecTuple;
197
198mod vm;
199use self::vm::CallResultOnly;
200pub use self::vm::{CallFrame, Isolated, Vm};
201
202mod vm_call;
203pub(crate) use self::vm_call::VmCall;
204
205pub(crate) mod vm_diagnostics;
206pub use self::vm_diagnostics::VmDiagnostics;
207pub(crate) use self::vm_diagnostics::VmDiagnosticsObj;
208
209mod vm_error;
210#[cfg(feature = "emit")]
211pub(crate) use self::vm_error::VmErrorAt;
212#[allow(deprecated)]
213pub use self::vm_error::VmResult;
214pub use self::vm_error::{ExpectedType, RuntimeError, VmError};
215pub(crate) use self::vm_error::{VmErrorKind, VmIntegerRepr};
216
217mod vm_execution;
218pub(crate) use self::vm_execution::ExecutionState;
219pub use self::vm_execution::{VmExecution, VmOutcome, VmResume, VmSendExecution};
220
221mod vm_halt;
222pub(crate) use self::vm_halt::{VmHalt, VmHaltInfo};
223
224mod fmt;
225pub use self::fmt::Formatter;
226
227mod control_flow;
228pub use self::control_flow::ControlFlow;
229
230mod hasher;
231pub use self::hasher::Hasher;
232
233crate::declare_dyn_fn! {
234 struct FunctionHandlerVTable;
235
236 pub struct FunctionHandler {
238 fn call(memory: &mut dyn Memory, addr: Address, count: usize, out: Output) -> Result<(), VmError>;
239 }
240}
241
242pub(crate) type FieldMap<K, V> = crate::alloc::HashMap<K, V>;
243
244#[inline(always)]
245pub(crate) fn new_field_map<K, V>() -> FieldMap<K, V> {
246 FieldMap::new()
247}
248
249#[inline(always)]
250pub(crate) fn new_field_hash_map_with_capacity<K, V>(
251 cap: usize,
252) -> crate::alloc::Result<FieldMap<K, V>> {
253 FieldMap::try_with_capacity(cap)
254}