Skip to main content

Module prelude

Module prelude 

Source
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::FromPyObjectOwned;
pub use crate::conversion::IntoPyObject;
pub use crate::marker::Python;
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::PyClassGuard;
pub use crate::PyClassGuardMut;
pub use crate::types::capsule::PyCapsuleMethods;
pub use crate::types::dict::PyDictMethods;
pub use crate::types::frozenset::PyFrozenSetMethods;
pub use crate::types::list::PyListMethods;
pub use crate::types::mappingproxy::PyMappingProxyMethods;
pub use crate::types::set::PySetMethods;
pub use crate::types::slice::PySliceMethods;
pub use crate::types::string::PyStringMethods;
pub use crate::types::tuple::PyTupleMethods;

Macros§

wrap_pyfunction
Wraps a Rust function annotated with #[pyfunction].

Structs§

Borrowed
A borrowed equivalent to Bound.
Bound
A Python thread-attached equivalent to Py<T>.
Py
A reference to an object allocated on the Python heap.
PyErr
Represents a Python exception.

Traits§

PyAnyMethods
This trait represents the Python APIs which are usable on all Python objects.
PyBoolMethods
Implementation of functionality for PyBool.
PyByteArrayMethods
Implementation of functionality for PyByteArray.
PyBytesMethods
Implementation of functionality for PyBytes.
PyComplexMethods
Implementation of functionality for PyComplex.
PyFloatMethods
Implementation of functionality for PyFloat.
PyMappingMethods
Implementation of functionality for PyMapping.
PyModuleMethods
Implementation of functionality for PyModule.
PySequenceMethods
Implementation of functionality for PySequence.
PyTracebackMethods
Implementation of functionality for PyTraceback.
PyTypeMethods
Implementation of functionality for PyType.
PyWeakrefMethods
Implementation of functionality for PyWeakref.

Type Aliases§

PyResult
Represents the result of a Python call.

Attribute Macros§

pyclass
pyfunction
A proc macro used to expose Rust functions to Python.
pymethods
A proc macro used to expose methods to Python.
pymodule
A proc macro used to implement Python modules.

Derive Macros§

FromPyObject
IntoPyObject
IntoPyObjectRef