Module pyo3::prelude [] [src]

The PyO3 Prelude

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::*;

Reexports

pub use super::py;
pub use class::*;
pub use typeob::PyRawObject;

Modules

exc

This module contains the standard python exception types.

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.

PyBool

Represents a Python bool.

PyByteArray

Represents a Python bytearray.

PyBytes

Represents a Python byte string.

PyDict

Represents a Python dict.

PyDowncastError

Marker type that indicates an error while downcasting

PyErr

Represents a Python exception that was raised.

PyFloat

Represents a Python float object.

PyFrozenSet

Represents a Python frozenset

PyInt

Represents a Python int object.

PyIterator

A python iterator object.

PyList

Represents a Python list.

PyLong

Represents a Python int object.

PyModule

Represents a Python module object.

PyObject

Safe wrapper around unsafe *mut ffi::PyObject pointer.

PyObjectRef

Represents general python instance.

PySequence

Represents a reference to a python object supporting the sequence protocol.

PySet

Represents a Python set

PySlice

Represents a Python slice.

PySliceIndices

Represents a Python slice indices

PyString

Represents a Python string.

PyToken
PyTuple

Represents a Python tuple object.

PyType

Represents a reference to a Python type object.

Python

Marker type that indicates that the GIL is currently held.

Enums

PyErrValue

Represents a PyErr value

PyStringData

Enum of possible Python string representations.

Traits

AsPyRef

Trait implements objet 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.

IntoPyPointer

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

IntoPyTuple

Conversion trait that allows various objects to be converted into PyTuple object.

ObjectProtocol

Python object model helper methods

PyErrArguments

Helper conversion trait that allows to use custom arguments for exception constructor.

PyObjectWithToken

Any instance that is managed Python can have access to gil.

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

RefFromPyObject
ToBorrowedObject
ToPyObject

Conversion trait that allows various objects to be converted into PyObject

ToPyPointer

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

Type Definitions

PyResult

Represents the result of a Python call.