Crate rustypy

Source
Expand description

Binding Rust with Python, both ways!

This library will generate and handle type conversions between Python and Rust. To use Python from Rust refer to the library wiki, more general examples and information on how to use Rust in Python can also be found there.

Checkout the PyTypes module documentation for more information on how to write foreign functions that are compliant with Python as well as using the custom types that will ease type conversion.

Re-exports§

pub use self::pytypes::pybool::PyBool;
pub use self::pytypes::pydict::PyDict;
pub use self::pytypes::pylist::PyList;
pub use self::pytypes::pystring::PyString;
pub use self::pytypes::pytuple::PyTuple;
pub use self::pytypes::PyArg;

Modules§

pytypes
Types for interfacing with Python.

Macros§

pytuple
This macro allows the construction of PyTuple types.
unpack_pydict
Consumes the content of a PyDict<K, T> as received from Python (raw pointer) and returns a HashMap<K, T> from it, no copies are performed in the process.
unpack_pylist
Consumes a PyList<PyArg(T)> content as recived from Python (raw pointer) and returns a Vec<T> from it, no copies are performed in the process.
unpack_pytuple
Iterates over a a PyTuple and returns a corresponding Rust tuple.
unpack_pytype
Converts python data to std Rust collections or tuples, moving the data: