[][src]Crate runestick

Rune Logo

Visit the site 🌐 - Read the book 📖

Build Status Site Status crates.io docs.rs Chat on Discord

A stack-based virtual machine for the Rust programming language.

This is the driver for the [Rune language]. [Rune Language]: https://rune-rs.github.io

Re-exports

pub use self::format::Format;
pub use self::format::FormatSpec;
pub use self::module::InstFnNameHash;
pub use self::module::Module;
pub use crate::debug::DebugInfo;
pub use crate::debug::DebugInst;

Modules

budget

Budgeting module for Runestick.

debug

Debug information for units.

format

Types for dealing with formatting specifications.

module

Crate used for definint native modules.

modules

Public packages that can be used to provide functionality to virtual machines.

Macros

span

Construct a span that can be used during pattern matching.

Structs

AnyObj

Our own private dynamic Any implementation.

AnyObjVtable

The vtable for any type stored in the virtual machine.

BorrowMut

Guard for data exclusively borrowed from a slot in the virtual machine.

BorrowRef

Guard for a data borrowed from a slot in the virtual machine.

ByteIndex

A single index in a Span, like the start or ending index.

Bytes

A vector of bytes.

CallFrame

A call frame.

CompileMeta

Compile-time metadata about a unit.

CompileMetaCapture

Metadata about a closure.

CompileMetaEmpty

The metadata about a type.

CompileMetaStruct

The metadata about a type.

CompileMetaTuple

The metadata about a variant.

CompileSource

Information on a compile sourc.

Context

Static run context visible to the virtual machine.

DebugLabel

A label that can be jumped to.

Future

A type-erased future that can only be unsafely polled in combination with the virtual machine that created it.

Generator

A generator with a stored virtual machine.

Hash

The hash of a primitive thing.

Id

An opaque identifier that is associated with AST items.

Interface

An interface which wraps a value and allows for accessing protocols.

Item

The name of an item.

Iterator

An owning iterator.

Label

A label that can be jumped to.

Mut

A strong mutable reference to the given type.

Names

A tree of names.

NotAccessibleMut

Error raised when tried to access for exclusive access but it was not accessible.

NotAccessibleRef

Error raised when tried to access for shared access but it was not accessible.

Object

Struct representing a dynamic anonymous object.

Panic

A descriptibe panic.

Protocol

A built in instance function.

RawExclusiveGuard

An exclusive access guard.

RawMut

A raw guard to a Ref.

RawRef

A raw guard to a Ref.

RawSharedGuard

A shared access guard.

RawStr

A raw static string.

Ref

A strong reference to the given type.

Rtti

Runtime information on variant.

Select

A stored select.

Shared

A shared value.

SharedPointerGuard

A guard for an Any containing a pointer.

Source

A single source file.

Span

A span corresponding to a range in the source file being parsed.

SpannedError

An error with an associated span.

Stack

The stack of the virtual machine, where all values are stored.

StackError

An error raised when interacting with the stack.

StaticString

Struct representing a static string.

StaticType

Static type information.

Stream

A stream with a stored virtual machine.

Struct

An object with a well-defined type.

StructVariant

An object with a well-defined variant of an enum.

Tuple

Struct representing a dynamic anonymous object.

TupleStruct

A tuple with a well-defined type.

TupleVariant

A tuple with a well-defined type as a variant of an enum.

Type

The type of an entry.

Unit

Instructions from a single source file.

UnitStruct

A empty with a well-defined type.

UnitTypeInfo

Type information on a unit.

UnitVariant

An object with a well-defined variant of an enum.

VariantRtti

Runtime information on variant.

Vec

Struct representing a dynamic vector.

VecTuple

A helper type to deserialize arrays with different interior types.

Vm

A stack which references variables indirectly from a slab.

VmCall

An instruction to push a virtual machine to the execution.

VmError

Errors raised by the execution of the virtual machine.

VmExecution

The execution environment for a virtual machine.

VmIntegerRepr

A type-erased rust number.

Enums

AccessError

An error raised while downcasting.

Awaited

A stored await task.

Call

How the function is called.

CompileMetaKind

Compile-time metadata kind about a unit.

Component

The component of an item.

ComponentRef

A reference to a component of an item.

ConstValue

A constant value.

ContextError

An error raised when building the context.

GeneratorState

The state of a generator.

Inst

An operation in the stack-based virtual machine.

InstAssignOp

An operation between two values on the machine.

InstOp

An operation between two values on the machine.

InstTarget

The target of an operation.

InstValue

A literal value that can be pushed.

PanicReason

Pre-canned panic reasons.

TypeCheck

An encoded type check.

TypeInfo

Type information about a value, that can be printed for human consumption through its Display implementation.

UnitFn

The kind and necessary information on registered functions.

Value

An entry on the stack.

VmErrorKind

The kind of error encountered.

VmHalt

The reason why the virtual machine execution stopped.

VmHaltInfo

The reason why the virtual machine execution stopped.

Constants

ADD

The function to implement for the addition operation.

ADD_ASSIGN

The function to implement for the addition assign operation.

BIT_AND

The function to implement for the bitwise and operation.

BIT_AND_ASSIGN

The function to implement for the bitwise and assign operation.

BIT_OR

The function to implement for the bitwise or operation.

BIT_OR_ASSIGN

The function to implement for the bitwise xor assign operation.

BIT_XOR

The function to implement for the bitwise xor operation.

BIT_XOR_ASSIGN

The function to implement for the bitwise xor assign operation.

DIV

The function to implement for the division operation.

DIV_ASSIGN

The function to implement for the division assign operation.

INDEX_GET

The function to access an index.

INDEX_SET

The function to set an index.

INTO_FUTURE

Function used to convert an argument into a future.

INTO_ITER

Function used to convert an argument into an iterator.

MUL

The function to implement for the multiply operation.

MUL_ASSIGN

The function to implement for the multiply assign operation.

NEXT

The function to call to continue iteration.

REM

The function to implement for the remainder operation.

REM_ASSIGN

The function to implement for the remainder assign operation.

SHL

The function to implement for the bitwise shift left operation.

SHL_ASSIGN

The function to implement for the bitwise shift left assign operation.

SHR

The function to implement for the bitwise shift right operation.

SHR_ASSIGN

The function to implement for the bitwise shift right assign operation.

STRING_DISPLAY

Protocol function used by template strings.

SUB

The function to implement for the subtraction operation.

SUB_ASSIGN

The function to implement for the subtraction assign operation.

Statics

BOOL_TYPE

The specialized type information for a bool type.

BYTES_TYPE

The specialized type information for a bytes type.

BYTE_TYPE

The specialized type information for a byte type.

CHAR_TYPE

The specialized type information for a char type.

FLOAT_TYPE

The specialized type information for a float type.

FORMAT_TYPE

The specialized type information for a fmt spec types.

FUNCTION_TYPE

The specialized type information for a function pointer type.

FUTURE_TYPE

The specialized type information for a future type.

GENERATOR_STATE_TYPE

The specialized type information for a generator state type.

GENERATOR_TYPE

The specialized type information for a generator type.

INTEGER_TYPE

The specialized type information for a integer type.

INTERFACE_TYPE

The specialized type information for an interface types.

ITERATOR_TYPE

The specialized type information for an interface types.

OBJECT_TYPE

The specialized type information for an anonymous object type.

OPTION_TYPE

The specialized type information for a option type.

RESULT_TYPE

The specialized type information for a result type.

STREAM_TYPE

The specialized type information for the Stream type.

STRING_TYPE

The specialized type information for a string type.

TUPLE_TYPE

The specialized type information for an anonymous tuple type.

UNIT_TYPE

The specialized type information for a unit.

VEC_TYPE

The specialized type information for a vector type.

Traits

Any

A trait which can be stored inside of an AnyObj.

Args

Trait for converting arguments onto the stack.

FromValue

Trait for converting from a value.

GuardedArgs

Trait for converting arguments onto the stack.

IntoByteIndex

Convert the given type into an index.

IntoComponent

Trait for encoding the current type into a component.

IntoTypeHash

Helper conversion into a function hash.

Named

Something that is named.

ToValue

Trait for converting types into values.

TypeOf

Trait used for Rust types for which we can determine the runtime type of.

UnsafeFromValue

A potentially unsafe conversion for value conversion.

UnsafeToValue

Trait for converting types into values.

WithSpan

Trait to coerce a result of a non-spanned error into a spanned error.

Type Definitions

Error

Exported boxed error type for convenience.

Function

A callable non-sync function.

Result

Exported result type for convenience.

SourceId

The identifier of a source file.

SyncFunction

A callable sync function. This currently only supports a subset of values that are supported by the Vm.

Derive Macros

Any

Macro to mark a value as external, which will implement all the appropriate traits.

FromValue

Conversion macro for constructing proxy objects from a dynamic value.