Type Definition pyo3::prelude::PyObject

source · []
pub type PyObject = Py<PyAny>;
Expand description

A commonly-used alias for Py<PyAny>.

This is an owned reference a Python object without any type information. This value can also be safely sent between threads.

See the documentation for Py.

Implementations

Casts the PyObject to a concrete Python object type.

This can cast only to native Python types, not types implemented in Rust. For a more flexible alternative, see Py::extract.

Casts the PyObject to a concrete Python object type without checking validity.

This can cast only to native Python types, not types implemented in Rust. For a more flexible alternative, see Py::extract.

Safety

Callers must ensure that the type is valid or risk type confusion.

👎Deprecated since 0.18.0:

use downcast() instead

Casts the PyObject to a concrete Python object type.

Trait Implementations

Converts to this type from the input type.

Converts to this type from the input type.