1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
//! <div align="center">
//! <a href="https://rune-rs.github.io/rune/">
//!     <b>Read the Book 📖</b>
//! </a>
//! </div>
//!
//! <br>
//!
//! <div align="center">
//! <a href="https://github.com/rune-rs/rune/actions">
//!     <img alt="Build Status" src="https://github.com/rune-rs/rune/workflows/Build/badge.svg">
//! </a>
//!
//! <a href="https://github.com/rune-rs/rune/actions">
//!     <img alt="Book Status" src="https://github.com/rune-rs/rune/workflows/Book/badge.svg">
//! </a>
//!
//! <a href="https://discord.gg/v5AeNkT">
//!     <img alt="Chat on Discord" src="https://img.shields.io/discord/558644981137670144.svg?logo=discord&style=flat-square">
//! </a>
//! </div>
//!
//! <br>
//!
//! A stack-based virtual machine for the Rust programming language.
//!
//! This is the driver for the [Rune language].
//! [Rune Language]: https://github.com/rune-rs/rune

#![deny(missing_docs)]

mod any;
mod context;
mod value;
mod vm;
#[macro_use]
mod macros;
mod access;
mod awaited;
mod bytes;
mod call;
mod debug;
mod function;
mod future;
mod generator;
mod generator_state;
mod hash;
mod inst;
mod item;
mod meta;
pub mod module;
pub mod modules;
mod names;
mod panic;
mod protocol;
mod reflection;
mod select;
mod serde;
mod shared;
mod source;
mod span;
mod stack;
mod static_string;
mod static_type;
mod stream;
mod tuple;
pub mod unit;
mod value_type;
mod value_type_info;
mod vec_tuple;
mod vm_call;
mod vm_error;
mod vm_execution;
mod vm_halt;

decl_external!(anyhow::Error);

/// Exported result type for convenience.
pub type Result<T, E = anyhow::Error> = std::result::Result<T, E>;

/// Exported boxed error type for convenience.
pub type Error = anyhow::Error;

pub use self::generator::Generator;
pub use self::generator_state::GeneratorState;
pub use self::meta::{Meta, MetaClosureCapture, MetaStruct, MetaTuple};
pub use self::module::Module;
pub use self::select::Select;
pub use self::source::Source;
pub use self::span::Span;
pub use self::static_string::StaticString;
pub use self::static_type::{
    StaticType, BOOL_TYPE, BYTES_TYPE, BYTE_TYPE, CHAR_TYPE, FLOAT_TYPE, FUNCTION_TYPE,
    FUTURE_TYPE, GENERATOR_STATE_TYPE, GENERATOR_TYPE, INTEGER_TYPE, OBJECT_TYPE, OPTION_TYPE,
    RESULT_TYPE, STREAM_TYPE, STRING_TYPE, TUPLE_TYPE, UNIT_TYPE, VEC_TYPE,
};
pub use self::stream::Stream;
pub use self::tuple::Tuple;
pub use self::value_type::ValueType;
pub use self::value_type_info::ValueTypeInfo;
pub use crate::access::{
    AccessError, BorrowMut, BorrowRef, NotAccessibleMut, NotAccessibleRef, RawBorrowedMut,
    RawBorrowedRef,
};
pub use crate::any::Any;
pub use crate::awaited::Awaited;
pub use crate::bytes::Bytes;
pub use crate::call::Call;
pub use crate::context::{Context, ContextError, IntoInstFnHash};
pub use crate::debug::{DebugInfo, DebugInst};
pub use crate::function::Function;
pub use crate::future::Future;
pub use crate::hash::{Hash, IntoHash};
pub use crate::inst::{Inst, PanicReason, TypeCheck};
pub use crate::item::{Component, Item};
pub use crate::names::Names;
pub use crate::panic::Panic;
pub use crate::protocol::{
    Protocol, ADD, ADD_ASSIGN, DIV, DIV_ASSIGN, INDEX_GET, INDEX_SET, INTO_FUTURE, INTO_ITER, MUL,
    MUL_ASSIGN, NEXT, REM, STRING_DISPLAY, SUB, SUB_ASSIGN,
};
pub use crate::reflection::{FromValue, IntoArgs, ReflectValueType, ToValue, UnsafeFromValue};
pub use crate::shared::{OwnedMut, OwnedRef, RawOwnedMut, RawOwnedRef, Shared};
pub use crate::stack::{Stack, StackError};
pub use crate::unit::{ImportEntry, ImportKey, Unit, UnitError};
pub use crate::value::{
    Integer, Object, TypedObject, TypedTuple, Value, VariantObject, VariantTuple,
};
pub use crate::vec_tuple::VecTuple;
pub use crate::vm::Vm;
pub use crate::vm_call::VmCall;
pub use crate::vm_error::{VmError, VmErrorKind};
pub use crate::vm_execution::VmExecution;
pub use crate::vm_halt::{VmHalt, VmHaltInfo};

mod collections {
    pub use hashbrown::HashMap;
    pub use hashbrown::HashSet;
}