I am trying to implement the trait PythonObject for a custom type.
impl PythonObject for PyTerm {
#[inline]
fn as_object(&self) -> &PyObject {
//???
}
#[inline]
fn into_object(self) -> PyObject {
//???
}
#[inline]
unsafe fn unchecked_downcast_from(o: PyObject) -> PyTerm {
std::mem::transmute(o)
}
#[inline]
unsafe fn unchecked_downcast_borrow_from(o: &PyObject) -> &PyTerm {
std::mem::transmute(o)
}
}
PyTerm is defined as a custom struct:
struct PyTerm {
// not important fields
}
PyTerm, first of all?