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

Structs

GILGuard

RAII type that represents the Global Interpreter Lock acquisition.

NoArgs

An empty struct that represents the empty argument list. Corresponds to the empty tuple () in Python.

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.

Traits

AsPyRef

Trait implements object reference extraction from python managed pointer.

FromPyObject

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

IntoPyObject

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

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.