Crate rustpython_vm
source ·Expand description
This crate contains most python logic.
- Compilation
- Bytecode
- Import mechanics
- Base objects
Re-exports
pub use self::convert::TryFromBorrowedObject;pub use self::convert::TryFromObject;pub use self::object::AsObject;pub use self::object::Py;pub use self::object::PyAtomicRef;pub use self::object::PyExact;pub use self::object::PyObject;pub use self::object::PyObjectRef;pub use self::object::PyPayload;pub use self::object::PyRef;pub use self::object::PyRefExact;pub use self::object::PyResult;pub use self::object::PyWeakRef;pub use self::vm::Context;pub use self::vm::Interpreter;pub use self::vm::Settings;pub use self::vm::VirtualMachine;pub use rustpython_common as common;pub use rustpython_literal as literal;
Modules
- This package contains the python basic/builtin types 7 common PyRef type aliases are exposed - PyBytesRef, PyDictRef, PyIntRef, PyListRef, PyStrRef, PyTypeRef, PyTupleRef Do not add more PyRef type aliases. They will be rare enough to use directly PyRef
. - byte operation APIs
- Implement python as a virtual machine with bytecode. This module implements bytecode structure.
- Implementation of Printf-Style string formatting as per the Python Docs.
- Utilities to define a new Python class
- Implement virtual machine to run instructions.
Macros
- Macro to match on the built-in class of a Python object.
Attribute Macros
- Helper macro to define
Exceptiontypes. More-or-less is an alias topyclassmacro.
Derive Macros
- use on struct with named fields like
struct A{x:PyRef<B>, y:PyRef<C>}to implTraversefor datatype.