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.
ⓘImportant traits for &'a mut R
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 PyObjectimpl PythonObject for PyTypeimpl PythonObject for PyModuleimpl PythonObject for PyStringimpl PythonObject for PyBytesimpl PythonObject for PyDictimpl PythonObject for PyBoolimpl PythonObject for PyTupleimpl PythonObject for PyListimpl PythonObject for PyLongimpl PythonObject for PyFloatimpl PythonObject for PySequenceimpl PythonObject for BaseExceptionimpl PythonObject for Exceptionimpl PythonObject for LookupErrorimpl PythonObject for AssertionErrorimpl PythonObject for AttributeErrorimpl PythonObject for EOFErrorimpl PythonObject for EnvironmentErrorimpl PythonObject for FloatingPointErrorimpl PythonObject for IOErrorimpl PythonObject for ImportErrorimpl PythonObject for IndexErrorimpl PythonObject for KeyErrorimpl PythonObject for KeyboardInterruptimpl PythonObject for MemoryErrorimpl PythonObject for NameErrorimpl PythonObject for NotImplementedErrorimpl PythonObject for OSErrorimpl PythonObject for OverflowErrorimpl PythonObject for ReferenceErrorimpl PythonObject for RuntimeErrorimpl PythonObject for SyntaxErrorimpl PythonObject for SystemErrorimpl PythonObject for SystemExitimpl PythonObject for TypeErrorimpl PythonObject for ValueErrorimpl PythonObject for WindowsErrorimpl PythonObject for ZeroDivisionErrorimpl PythonObject for BufferErrorimpl PythonObject for UnicodeDecodeErrorimpl PythonObject for UnicodeEncodeErrorimpl PythonObject for UnicodeTranslateError