[][src]Module pyo3::prelude

A collection of items you most likely want to have in scope when working with pyo3

The purpose of this module is to alleviate imports of many common pyo3 traits by adding a glob import to the top of pyo3 heavy modules:

use pyo3::prelude::*;

Re-exports

pub use crate::pycell::PyCell;
pub use crate::pycell::PyRef;
pub use crate::pycell::PyRefMut;
pub use crate::pyclass_init::PyClassInitializer;
pub use crate::FromPy;
pub use crate::FromPyObject;
pub use crate::IntoPy;
pub use crate::IntoPyPointer;
pub use crate::PyTryFrom;
pub use crate::PyTryInto;
pub use crate::ToPyObject;

Structs

GILGuard

RAII type that represents the Global Interpreter Lock acquisition.

Py

A Python object of known type.

PyAny

A Python object with GIL lifetime

PyErr

Represents a Python exception that was raised.

PyModule

Represents a Python module object.

PyObject

A Python object of any type.

Python

Marker type that indicates that the GIL is currently held.

Traits

AsPyRef

Retrieves &'py types from Py<T> or PyObject.

Type Definitions

PyResult

Represents the result of a Python call.

Attribute Macros

pyclass
pyfunction
pymethods
pymodule

Internally, this proc macro create a new c function called PyInit_{my_module} that then calls the init function you provided

pyproto