[][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::PyRawObject;
pub use pyo3cls::pymodule;
pub use pyo3cls::pyclass;
pub use pyo3cls::pyfunction;
pub use pyo3cls::pymethods;
pub use pyo3cls::pyproto;

Structs

GILGuard

RAII type that represents the Global Interpreter Lock acquisition.

Py

Safe wrapper around unsafe *mut ffi::PyObject pointer with specified type information.

PyErr

Represents a Python exception that was raised.

PyModule

Represents a Python module object.

PyObject

A python object

PyRef

A special reference of type T. PyRef<T> refers a instance of T, which exists in the Python heap as a part of a Python object.

PyRefMut

Mutable version of PyRef.

Python

Marker type that indicates that the GIL is currently held.

Traits

AsPyRef

Trait implements object reference extraction from python managed pointer.

FromPy

Similar to std::convert::From, just that it requires a gil token.

FromPyObject

FromPyObject is implemented by various types that can be extracted from a Python object reference.

IntoPy

Similar to std::convert::Into, just that it requires a gil token.

IntoPyObject

Conversion trait that allows various objects to be converted into PyObject by consuming original object.

IntoPyPointer

This trait allows retrieving the underlying FFI pointer from Python objects.

ObjectProtocol

Python object model helper methods

PyTryFrom

Trait implemented by Python object types that allow a checked downcast. This trait is similar to std::convert::TryFrom

PyTryInto

Trait implemented by Python object types that allow a checked downcast. This trait is similar to std::convert::TryInto

ToPyObject

Conversion trait that allows various objects to be converted into PyObject

Type Definitions

PyResult

Represents the result of a Python call.