fn generate_method(
            ptr: &FnPtr,
            body: Block,
            safe_functions: &phf::Set<&'static str>,
        ) -> ImplItem {
            let is_safe = ptr.is_safe(safe_functions);
            let attrs = if is_safe {
                vec![]
            } else {
                vec![
                    syn::parse_quote! {
                        /// # Safety
                    },
                    syn::parse_quote! {
                        ///
                    },
                    syn::parse_quote! {
                        /// REAPER can crash if you pass an invalid pointer.
                    },
                ]
            };
            ImplItem::Method(ImplItemMethod {
                attrs,
                vis: Visibility::Public(VisPublic {
                    pub_token: Pub {
                        span: Span::call_site(),
                    },
                }),
                defaultness: None,
                sig: extract_signature(ptr, ptr.name.clone(), !is_safe, true),
                block: body,
            })
        }
/// Generates a method definition in the body of e.g. `impl Reaper`.
Generates a method definition in the body of e.g. `impl Reaper`.
Generates a method definition in the body of e . g . ` impl Reaper ` .
fn generate_method(
            ptr: &FnPtr,
            body: Block,
            safe_functions: &phf::Set<&'static str>,
        ) -> ImplItem {
            let is_safe = ptr.is_safe(safe_functions);
            let attrs = if is_safe {
                vec![]
            } else {
                vec![
                    syn::parse_quote! {
                        /// # Safety
                    },
                    syn::parse_quote! {
                        ///
                    },
                    syn::parse_quote! {
                        /// REAPER can crash if you pass an invalid pointer.
                    },
                ]
            };
            ImplItem::Method(ImplItemMethod {
                attrs,
                vis: Visibility::Public(VisPublic {
                    pub_token: Pub {
                        span: Span::call_site(),
                    },
                }),
                defaultness: None,
                sig: extract_signature(ptr, ptr.name.clone(), !is_safe, true),
                block: body,
            })
        }
fn generate_method ( ptr : & FnPtr , body : Block , safe_functions : & phf :: Set < & ' static str > , ) -> ImplItem { let is_safe = ptr . is_safe ( safe_functions ) ; let attrs = if is_safe { vec ! [ ] } else { vec ! [ syn parse_quote { /// # Safety } syn parse_quote { } syn parse_quote { /// REAPER can crash if you pass an invalid pointer. } ] } ; ImplItem :: Method ( ImplItemMethod { attrs , vis : Visibility :: Public ( VisPublic { pub_token : Pub { span : Span :: call_site ( ) , } , } ) , defaultness : None , sig : extract_signature ( ptr , ptr . name . clone ( ) , ! is_safe , true ) , block : body , } ) }
Generates a method definition in the body of e.g.
Generates a method definition in the body of e . g .
ptr
&FnPtr
body
Block
safe_functions
&phf::Set<&'static str>
ptr
&FnPtr
body
Block
safe_functions
&phf::Set<&'static str>