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