Expand description
PyO3’s prelude.
The purpose of this module is to alleviate imports of many commonly used items of the PyO3 crate by adding a glob import to the top of pyo3 heavy modules:
use pyo3::prelude::*;
Re-exports§
pub use crate::conversion::FromPyObject;
pub use crate::conversion::IntoPy;
pub use crate::conversion::ToPyObject;
pub use crate::conversion::PyTryFrom;
Deprecatedpub use crate::conversion::PyTryInto;
Deprecatedpub use crate::marker::Python;
pub use crate::pycell::PyCell;
pub use crate::pycell::PyRef;
pub use crate::pycell::PyRefMut;
pub use crate::pyclass_init::PyClassInitializer;
pub use crate::types::PyAny;
pub use crate::types::PyModule;
pub use crate::PyNativeType;
Macros§
- wrap_pyfunction
macros
Wraps a Rust function annotated with#[pyfunction]
. - wrap_pyfunction_bound
macros
Wraps a Rust function annotated with#[pyfunction]
.
Structs§
- A borrowed equivalent to
Bound
. - A GIL-attached equivalent to
Py
. - A GIL-independent reference to an object allocated on the Python heap.
- Represents a Python exception.
Traits§
- This trait represents the Python APIs which are usable on all Python objects.
- Implementation of functionality for
PyBool
. - Implementation of functionality for
PyByteArray
. - Implementation of functionality for
PyBytes
. - Implementation of functionality for
PyCapsule
. - Implementation of functionality for
PyComplex
. - Implementation of functionality for
PyDict
. - Implementation of functionality for
PyFloat
. - Implementation of functionality for
PyFrozenSet
. - Implementation of functionality for
PyList
. - Implementation of functionality for
PyMapping
. - Implementation of functionality for
PyModule
. - Implementation of functionality for
PySequence
. - Implementation of functionality for
PySet
. - Implementation of functionality for
PySlice
. - Implementation of functionality for
PyString
. - Implementation of functionality for
PyTraceback
. - Implementation of functionality for
PyTuple
. - Implementation of functionality for
PyType
.
Type Aliases§
- A commonly-used alias for
Py<PyAny>
. - Represents the result of a Python call.
Attribute Macros§
- pyclass
macros
- pyfunction
macros
A proc macro used to expose Rust functions to Python. - pymethods
macros
A proc macro used to expose methods to Python. - pymodule
macros
A proc macro used to implement Python modules.
Derive Macros§
- FromPyObject
macros