pub trait PyTryFrom<T>: Sized {
    fn py_try_from(py: Python<'_>, item: Py<T>) -> PyResult<Self>;
    fn py_try_from_ref(py: Python<'_>, item: &T) -> PyResult<Self>;
}
Expand description

Convert from a Python type to a Rust type.

Required Methods§

Convert from a Py<T>. Defaults to delegating to py_from_ref.

Errors

Any errors that may occur during conversion.

Convert from a reference to the Python data.

Errors

Any errors that may occur during conversion.

Implementations on Foreign Types§

Implementors§