Trait TryIntoPyObjectUnsafe

Source
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§

Source

unsafe fn try_to_object_unsafe(self, py: Python<'py>) -> PyResult<Bound<'py, P>>

Implementations on Foreign Types§

Source§

impl<'a, 'py, K, V> TryIntoPyObjectUnsafe<'py, PyDict> for &'a HashMap<K, V>
where &'a K: IntoPyObject<'py> + Eq + Hash, &'a V: TryIntoPyObjectUnsafe<'py, PyAny>, K: 'a, V: 'a,

Helper impl for casting into kwargs for python functions calls.

Source§

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.

Source§

unsafe fn try_to_object_unsafe( self, py: Python<'py>, ) -> PyResult<Bound<'py, PyTuple>>

Implementors§

Source§

impl<'a, 'py, T> TryIntoPyObjectUnsafe<'py, PyAny> for &'a PyTree<T>
where &'a T: TryIntoPyObjectUnsafe<'py, PyAny>, T: 'a,

Serialize into a PyObject.