[][src]Crate rustypy

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.


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;



Types for interfacing with Python.



This macro allows the construction of PyTuple types.


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.


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.


Iterates over a a PyTuple and returns a corresponding Rust tuple.


Converts python data to std Rust collections or tuples, moving the data: