pub trait TryIntoPyObjectUnsafe<'py, P> {
// Required method
unsafe fn try_to_object_unsafe(
self,
py: Python<'py>,
) -> PyResult<Bound<'py, P>>;
}Expand description
A variant of pyo3::IntoPyObject used to wrap unsafe impls and propagates the
unsafety to the caller.
Required Methods§
Sourceunsafe fn try_to_object_unsafe(self, py: Python<'py>) -> PyResult<Bound<'py, P>>
unsafe fn try_to_object_unsafe(self, py: Python<'py>) -> PyResult<Bound<'py, P>>
§Safety
The caller must ensure self is valid for the duration of the call and that the type-erased pointer invariants of the trait are upheld.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<'a, 'py, K, V> TryIntoPyObjectUnsafe<'py, PyDict> for &'a HashMap<K, V>
Helper impl for casting into kwargs for python functions calls.
impl<'a, 'py, K, V> TryIntoPyObjectUnsafe<'py, PyDict> for &'a HashMap<K, V>
Helper impl for casting into kwargs for python functions calls.
unsafe fn try_to_object_unsafe( self, py: Python<'py>, ) -> PyResult<Bound<'py, PyDict>>
Source§impl<'a, 'py, T> TryIntoPyObjectUnsafe<'py, PyTuple> for &'a Vec<T>where
&'a T: TryIntoPyObjectUnsafe<'py, PyAny>,
T: 'a,
Helper impl for casting into args for python functions calls.
impl<'a, 'py, T> TryIntoPyObjectUnsafe<'py, PyTuple> for &'a Vec<T>where
&'a T: TryIntoPyObjectUnsafe<'py, PyAny>,
T: 'a,
Helper impl for casting into args for python functions calls.
unsafe fn try_to_object_unsafe( self, py: Python<'py>, ) -> PyResult<Bound<'py, PyTuple>>
Implementors§
impl<'a, 'py, T> TryIntoPyObjectUnsafe<'py, PyAny> for &'a PyTree<T>where
&'a T: TryIntoPyObjectUnsafe<'py, PyAny>,
T: 'a,
Serialize into a PyObject.