Leases the native context carried by a Python `ProxyContext`.
(value: &Bound<'_, PyAny>)
| 76 | |
| 77 | /// Leases the native context carried by a Python `ProxyContext`. |
| 78 | pub(crate) fn lease_from_python(value: &Bound<'_, PyAny>) -> PyResult<PyProxyContextLease> { |
| 79 | value |
| 80 | .getattr("_native")? |
| 81 | .extract::<PyRef<'_, PyProxyContext>>()? |
| 82 | .lease() |
| 83 | } |
| 84 | |
| 85 | /// Inserts a typed value into a Python context's native state. |
| 86 | pub(crate) fn insert_into_python<T>(value: &Bound<'_, PyAny>, item: T) -> PyResult<()> |