Trait pyo3::ffi_ptr_ext::FfiPtrExt

source ·
pub(crate) trait FfiPtrExt: Sealed {
    // Required methods
    unsafe fn assume_owned_or_err(
        self,
        py: Python<'_>
    ) -> PyResult<Bound<'_, PyAny>>;
    unsafe fn assume_owned_or_opt(
        self,
        py: Python<'_>
    ) -> Option<Bound<'_, PyAny>>;
    unsafe fn assume_owned(self, py: Python<'_>) -> Bound<'_, PyAny>;
    unsafe fn assume_borrowed_or_err<'a>(
        self,
        py: Python<'_>
    ) -> PyResult<Borrowed<'a, '_, PyAny>>;
    unsafe fn assume_borrowed_or_opt<'a>(
        self,
        py: Python<'_>
    ) -> Option<Borrowed<'a, '_, PyAny>>;
    unsafe fn assume_borrowed<'a>(
        self,
        py: Python<'_>
    ) -> Borrowed<'a, '_, PyAny>;
    unsafe fn assume_borrowed_unchecked<'a>(
        self,
        py: Python<'_>
    ) -> Borrowed<'a, '_, PyAny>;
}

Required Methods§

source

unsafe fn assume_owned_or_err( self, py: Python<'_> ) -> PyResult<Bound<'_, PyAny>>

source

unsafe fn assume_owned_or_opt(self, py: Python<'_>) -> Option<Bound<'_, PyAny>>

source

unsafe fn assume_owned(self, py: Python<'_>) -> Bound<'_, PyAny>

source

unsafe fn assume_borrowed_or_err<'a>( self, py: Python<'_> ) -> PyResult<Borrowed<'a, '_, PyAny>>

Assumes this pointer is borrowed from a parent object.

Warning: the lifetime 'a is not bounded by the function arguments; the caller is responsible to ensure this is tied to some appropriate lifetime.

source

unsafe fn assume_borrowed_or_opt<'a>( self, py: Python<'_> ) -> Option<Borrowed<'a, '_, PyAny>>

Same as assume_borrowed_or_err, but doesn’t fetch an error on NULL.

source

unsafe fn assume_borrowed<'a>(self, py: Python<'_>) -> Borrowed<'a, '_, PyAny>

Same as assume_borrowed_or_err, but panics on NULL.

source

unsafe fn assume_borrowed_unchecked<'a>( self, py: Python<'_> ) -> Borrowed<'a, '_, PyAny>

Same as assume_borrowed_or_err, but does not check for NULL.

Implementations on Foreign Types§

source§

impl FfiPtrExt for *mut PyObject

source§

unsafe fn assume_owned_or_err( self, py: Python<'_> ) -> PyResult<Bound<'_, PyAny>>

source§

unsafe fn assume_owned_or_opt(self, py: Python<'_>) -> Option<Bound<'_, PyAny>>

source§

unsafe fn assume_owned(self, py: Python<'_>) -> Bound<'_, PyAny>

source§

unsafe fn assume_borrowed_or_err<'a>( self, py: Python<'_> ) -> PyResult<Borrowed<'a, '_, PyAny>>

source§

unsafe fn assume_borrowed_or_opt<'a>( self, py: Python<'_> ) -> Option<Borrowed<'a, '_, PyAny>>

source§

unsafe fn assume_borrowed<'a>(self, py: Python<'_>) -> Borrowed<'a, '_, PyAny>

source§

unsafe fn assume_borrowed_unchecked<'a>( self, py: Python<'_> ) -> Borrowed<'a, '_, PyAny>

Implementors§

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