pub trait PythonObject:
ToPyObject
+ Send
+ Sized
+ 'static {
// Required methods
fn as_object(&self) -> &PyObject;
fn into_object(self) -> PyObject;
unsafe fn unchecked_downcast_from(obj: PyObject) -> Self;
unsafe fn unchecked_downcast_borrow_from(obj: &PyObject) -> &Self;
}
Expand description
Trait implemented by all Python object types.
Required Methods§
Sourcefn into_object(self) -> PyObject
fn into_object(self) -> PyObject
Casts the Python object to PyObject.
Sourceunsafe fn unchecked_downcast_from(obj: PyObject) -> Self
unsafe fn unchecked_downcast_from(obj: PyObject) -> Self
Unchecked downcast from PyObject to Self. Undefined behavior if the input object does not have the expected type.
Sourceunsafe fn unchecked_downcast_borrow_from(obj: &PyObject) -> &Self
unsafe fn unchecked_downcast_borrow_from(obj: &PyObject) -> &Self
Unchecked downcast from PyObject to Self. Undefined behavior if the input object does not have the expected type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.