Crate rustypy [] [src]

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.

Reexports

pub use self::pytypes::pybool::PyBool;
pub use self::pytypes::pystring::PyString;
pub use self::pytypes::pylist::PyList;
pub use self::pytypes::pydict::PyDict;
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 a *mut PyDict<K, T> as *mut size_t content and returns a HashMap<K, T> from it, no copies are performed in the process.

unpack_pylist

Consumes a Box<PyList<PyArg(T)>> content 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.