fn impl_wrap_init(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) -> _pyo3::c_int
        {
            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: PyResult<()> = {
                #body
            };
            match _result {
                Ok(_) => 0,
                Err(e) => {
                    e.restore(_py);
                    -1
                }
            }
        }
    }
}
/// Generate function wrapper for ffi::initproc
Generate function wrapper for ffi::initproc
Generate function wrapper for ffi :: initproc
fn impl_wrap_init(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) -> _pyo3::c_int
        {
            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: PyResult<()> = {
                #body
            };
            match _result {
                Ok(_) => 0,
                Err(e) => {
                    e.restore(_py);
                    -1
                }
            }
        }
    }
}
fn impl_wrap_init ( 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 ) _pyo3 c_int { 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 PyResult ( ) { body } match _result { Ok ( ) 0 Err ( e ) { e restore ( _py ) 1 } } } } }
Generate function wrapper for ffi::initproc
Generate function wrapper for ffi :: initproc
cls
&Box<syn::Ty>
name
&syn::Ident
spec
&FnSpec
cls
&Box<syn::Ty>
name
&syn::Ident
spec
&FnSpec