[][src]Trait pyo3::ReturnTypeIntoPyResult

pub trait ReturnTypeIntoPyResult {
    type Inner;
    fn return_type_into_py_result(self) -> PyResult<Self::Inner>;
}

This trait wraps a T: IntoPyObject into PyResult while PyResult remains PyResult.

This is necessaty because proc macros run before typechecking and can't decide whether a return type is a (possibly aliased) PyResult or not. It is also quite handy because the codegen is currently built on the assumption that all functions return a PyResult.

Associated Types

type Inner

Loading content...

Required methods

Loading content...

Implementors

impl<T: IntoPyObject> ReturnTypeIntoPyResult for T[src]

impl<T: IntoPyObject> ReturnTypeIntoPyResult for PyResult<T>[src]

Loading content...