Trait pyo3::PyTryFrom[][src]

pub trait PyTryFrom: Sized {
    type Error;
    fn try_from(value: &PyObjectRef) -> Result<&Self, Self::Error>;
fn try_from_exact(value: &PyObjectRef) -> Result<&Self, Self::Error>;
fn try_from_mut(value: &PyObjectRef) -> Result<&mut Self, Self::Error>;
fn try_from_mut_exact(value: &PyObjectRef) -> Result<&mut Self, Self::Error>; }

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

Associated Types

The type returned in the event of a conversion error.

Required Methods

Cast from a concrete Python object type to PyObject.

Cast from a concrete Python object type to PyObject. With exact type check.

Cast from a concrete Python object type to PyObject.

Cast from a concrete Python object type to PyObject. With exact type check.

Implementors