Trait cpython::PythonObjectWithCheckedDowncast[][src]

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

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

Required methods

fn downcast_from(
    py: Python<'_>,
    obj: PyObject
) -> Result<Self, PythonObjectDowncastError<'_>>
[src]

Cast from PyObject to a concrete Python object type.

fn downcast_borrow_from<'a, 'p>(
    py: Python<'p>,
    obj: &'a PyObject
) -> Result<&'a Self, PythonObjectDowncastError<'p>>
[src]

Cast from PyObject to a concrete Python object type.

Loading content...

Implementors

impl PythonObjectWithCheckedDowncast for AssertionError[src]

impl PythonObjectWithCheckedDowncast for AttributeError[src]

impl PythonObjectWithCheckedDowncast for BaseException[src]

impl PythonObjectWithCheckedDowncast for BufferError[src]

impl PythonObjectWithCheckedDowncast for EOFError[src]

impl PythonObjectWithCheckedDowncast for EnvironmentError[src]

impl PythonObjectWithCheckedDowncast for Exception[src]

impl PythonObjectWithCheckedDowncast for FloatingPointError[src]

impl PythonObjectWithCheckedDowncast for IOError[src]

impl PythonObjectWithCheckedDowncast for ImportError[src]

impl PythonObjectWithCheckedDowncast for IndexError[src]

impl PythonObjectWithCheckedDowncast for KeyError[src]

impl PythonObjectWithCheckedDowncast for KeyboardInterrupt[src]

impl PythonObjectWithCheckedDowncast for LookupError[src]

impl PythonObjectWithCheckedDowncast for MemoryError[src]

impl PythonObjectWithCheckedDowncast for NameError[src]

impl PythonObjectWithCheckedDowncast for NotImplementedError[src]

impl PythonObjectWithCheckedDowncast for OSError[src]

impl PythonObjectWithCheckedDowncast for OverflowError[src]

impl PythonObjectWithCheckedDowncast for ReferenceError[src]

impl PythonObjectWithCheckedDowncast for RuntimeError[src]

impl PythonObjectWithCheckedDowncast for StandardError[src]

impl PythonObjectWithCheckedDowncast for SyntaxError[src]

impl PythonObjectWithCheckedDowncast for SystemError[src]

impl PythonObjectWithCheckedDowncast for SystemExit[src]

impl PythonObjectWithCheckedDowncast for TypeError[src]

impl PythonObjectWithCheckedDowncast for UnicodeDecodeError[src]

impl PythonObjectWithCheckedDowncast for UnicodeEncodeError[src]

impl PythonObjectWithCheckedDowncast for UnicodeTranslateError[src]

impl PythonObjectWithCheckedDowncast for ValueError[src]

impl PythonObjectWithCheckedDowncast for ZeroDivisionError[src]

impl PythonObjectWithCheckedDowncast for PyClass[src]

impl PythonObjectWithCheckedDowncast for PyInstance[src]

impl PythonObjectWithCheckedDowncast for PyBool[src]

impl PythonObjectWithCheckedDowncast for PyBytes[src]

impl PythonObjectWithCheckedDowncast for PyCapsule[src]

impl PythonObjectWithCheckedDowncast for PyDict[src]

impl PythonObjectWithCheckedDowncast for PyFloat[src]

impl PythonObjectWithCheckedDowncast for PyInt[src]

impl PythonObjectWithCheckedDowncast for PyList[src]

impl PythonObjectWithCheckedDowncast for PyLong[src]

impl PythonObjectWithCheckedDowncast for PyModule[src]

impl PythonObjectWithCheckedDowncast for PyObject[src]

impl PythonObjectWithCheckedDowncast for PySequence[src]

impl PythonObjectWithCheckedDowncast for PySet[src]

impl PythonObjectWithCheckedDowncast for PyString[src]

impl PythonObjectWithCheckedDowncast for PyTuple[src]

impl PythonObjectWithCheckedDowncast for PyType[src]

impl PythonObjectWithCheckedDowncast for PyUnicode[src]

Loading content...