Trait pyo3::ToBorrowedObject [] [src]

pub trait ToBorrowedObject: ToPyObject {
    fn with_borrowed_ptr<F, R>(&self, py: Python, f: F) -> R
    where
        F: FnOnce(*mut PyObject) -> R
; }

Required Methods

Converts self into a Python object and calls the specified closure on the native FFI pointer underlying the Python object.

May be more efficient than to_object because it does not need to touch any reference counts when the input object already is a Python object.

Implementations on Foreign Types

impl ToBorrowedObject for bool
[src]

[src]

Implementors