Skip to main content

cast_bound_ref_trusted

Function cast_bound_ref_trusted 

Source
pub unsafe fn cast_bound_ref_trusted<'a, 'py, T: PyTypeCheck>(
    bound_ref: &'a Bound<'py, PyAny>,
) -> PyResult<&'a Bound<'py, T>>
Expand description

Indirection around Bound::cast_unchecked which performs checks on PyPy, to be used in contexts where CPython has already performed the check.

§Safety

bound_ref must be of type T

⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here