Trait cpython::PythonObject
[−]
[src]
pub trait PythonObject: ToPyObject + Send + Sized + 'static { fn as_object(&self) -> &PyObject; fn into_object(self) -> PyObject; unsafe fn unchecked_downcast_from(_: PyObject) -> Self; unsafe fn unchecked_downcast_borrow_from(_: &PyObject) -> &Self; }
Trait implemented by all Python object types.
Required Methods
fn as_object(&self) -> &PyObject
Casts the Python object to PyObject.
fn into_object(self) -> PyObject
Casts the Python object to PyObject.
unsafe fn unchecked_downcast_from(_: PyObject) -> Self
Unchecked downcast from PyObject to Self. Undefined behavior if the input object does not have the expected type.
unsafe fn unchecked_downcast_borrow_from(_: &PyObject) -> &Self
Unchecked downcast from PyObject to Self. Undefined behavior if the input object does not have the expected type.
Implementors
impl PythonObject for PyObject
impl PythonObject for PyType
impl PythonObject for PyModule
impl PythonObject for PyString
impl PythonObject for PyBytes
impl PythonObject for PyDict
impl PythonObject for PyBool
impl PythonObject for PyTuple
impl PythonObject for PyList
impl PythonObject for PyLong
impl PythonObject for PyFloat
impl PythonObject for PySequence
impl PythonObject for BaseException
impl PythonObject for Exception
impl PythonObject for LookupError
impl PythonObject for AssertionError
impl PythonObject for AttributeError
impl PythonObject for EOFError
impl PythonObject for EnvironmentError
impl PythonObject for FloatingPointError
impl PythonObject for IOError
impl PythonObject for ImportError
impl PythonObject for IndexError
impl PythonObject for KeyError
impl PythonObject for KeyboardInterrupt
impl PythonObject for MemoryError
impl PythonObject for NameError
impl PythonObject for NotImplementedError
impl PythonObject for OSError
impl PythonObject for OverflowError
impl PythonObject for ReferenceError
impl PythonObject for RuntimeError
impl PythonObject for SyntaxError
impl PythonObject for SystemError
impl PythonObject for SystemExit
impl PythonObject for TypeError
impl PythonObject for ValueError
impl PythonObject for ZeroDivisionError
impl PythonObject for BufferError
impl PythonObject for UnicodeDecodeError
impl PythonObject for UnicodeEncodeError
impl PythonObject for UnicodeTranslateError