Trait cpython::PythonObjectWithCheckedDowncast [] [src]

pub trait PythonObjectWithCheckedDowncast: PythonObject {
    fn downcast_from<'p>(
        _: Python<'p>,
        _: PyObject
    ) -> Result<Self, PythonObjectDowncastError<'p>>;
fn downcast_borrow_from<'a, 'p>(
        _: Python<'p>,
        _: &'a PyObject
    ) -> Result<&'a Self, PythonObjectDowncastError<'p>>; }

Trait implemented by Python object types that allow a checked downcast.

Required Methods

Cast from PyObject to a concrete Python object type.

Cast from PyObject to a concrete Python object type.

Implementors