[][src]Trait pyo3::PyTryFrom

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

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

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