Type Definition pyo3::PyObject [−][src]
type PyObject = Py<PyAny>;
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
impl PyObject
[src]
pub fn cast_as<'p, D>(
&'p self,
py: Python<'p>
) -> Result<&'p D, PyDowncastError<'_>> where
D: PyTryFrom<'p>,
[src]
&'p self,
py: Python<'p>
) -> Result<&'p D, PyDowncastError<'_>> where
D: PyTryFrom<'p>,
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
.