# pyo3::prelude - Rust
Keywords: rust, rustlang, rust-lang, prelude

# Module pyo3::prelude [−] [src]

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::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. To get hold of a value of this type, see `Python::acquire_gil`.
Py | A Python object of known type T.
PyAny | A Python object with GIL lifetime
PyErr | Represents a Python exception that was raised.
PyModule | Represents a Python `module` object.
Python | Marker type that indicates that the GIL is currently held.

## Type Definitions

PyObject | A commonly-used alias for `Py<PyAny>`.
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 |

## Derive Macros

FromPyObject |