pub fn impl_proto_wrap(cls: &Box<syn::Ty>, name: &syn::Ident, spec: &FnSpec) -> Tokens {
    let cb = impl_call(cls, name, &spec);
    let body = impl_arg_params(&spec, cb);

    quote! {
        #[allow(unused_mut)]
        unsafe extern "C" fn __wrap(
            _slf: *mut _pyo3::ffi::PyObject,
            _args: *mut _pyo3::ffi::PyObject,
            _kwargs: *mut _pyo3::ffi::PyObject) -> *mut _pyo3::ffi::PyObject
        {
            const _LOCATION: &'static str = concat!(stringify!(#cls),".",stringify!(#name),"()");
            let _pool = _pyo3::GILPool::new();
            let _py = _pyo3::Python::assume_gil_acquired();
            let _slf = _py.mut_from_borrowed_ptr::<#cls>(_slf);
            let _args = _py.from_borrowed_ptr::<_pyo3::PyTuple>(_args);
            let _kwargs = _pyo3::argparse::get_kwargs(_py, _kwargs);

            let _result = {
                #body
            };
            _pyo3::callback::cb_convert(
                _pyo3::callback::PyObjectCallbackConverter, _py, _result)
        }
    }
}
/// Generate function wrapper for protocol method (PyCFunction, PyCFunctionWithKeywords)
Generate function wrapper for protocol method (PyCFunction, PyCFunctionWithKeywords)
Generate function wrapper for protocol method ( PyCFunction PyCFunctionWithKeywords )
pub fn impl_proto_wrap(cls: &Box<syn::Ty>, name: &syn::Ident, spec: &FnSpec) -> Tokens {
    let cb = impl_call(cls, name, &spec);
    let body = impl_arg_params(&spec, cb);
    quote! {
        #[allow(unused_mut)]
        unsafe extern "C" fn __wrap(
            _slf: *mut _pyo3::ffi::PyObject,
            _args: *mut _pyo3::ffi::PyObject,
            _kwargs: *mut _pyo3::ffi::PyObject) -> *mut _pyo3::ffi::PyObject
        {
            const _LOCATION: &'static str = concat!(stringify!(#cls),".",stringify!(#name),"()");
            let _pool = _pyo3::GILPool::new();
            let _py = _pyo3::Python::assume_gil_acquired();
            let _slf = _py.mut_from_borrowed_ptr::<#cls>(_slf);
            let _args = _py.from_borrowed_ptr::<_pyo3::PyTuple>(_args);
            let _kwargs = _pyo3::argparse::get_kwargs(_py, _kwargs);
            let _result = {
                #body
            };
            _pyo3::callback::cb_convert(
                _pyo3::callback::PyObjectCallbackConverter, _py, _result)
        }
    }
}
pub fn impl_proto_wrap ( cls : & Box < syn :: Ty > , name : & syn :: Ident , spec : & FnSpec ) -> Tokens { let cb = impl_call ( cls , name , & spec ) ; let body = impl_arg_params ( & spec , cb ) ; quote ! { [ allow ( unused_mut ) ] unsafe extern " " fn __wrap ( _slf mut _pyo3 ffi PyObject _args mut _pyo3 ffi PyObject _kwargs mut _pyo3 ffi PyObject ) mut _pyo3 ffi PyObject { const _LOCATION ' static str concat ( stringify ( cls ) " " stringify ( name ) " " ) let _pool _pyo3 GILPool new ( ) let _py _pyo3 Python assume_gil_acquired ( ) let _slf _py mut_from_borrowed_ptr cls ( _slf ) let _args _py from_borrowed_ptr pyo3 PyTuple ( _args ) let _kwargs _pyo3 argparse get_kwargs ( _py _kwargs ) let _result { body } _pyo3 callback cb_convert ( _pyo3 callback PyObjectCallbackConverter _py _result ) } } }
Generate function wrapper for protocol method (PyCFunction, PyCFunctionWithKeywords)
Generate function wrapper for protocol method ( PyCFunction PyCFunctionWithKeywords )
cls
&Box<syn::Ty>
name
&syn::Ident
spec
&FnSpec
cls
&Box<syn::Ty>
name
&syn::Ident
spec
&FnSpec