pub fn core_type(&self) -> CoreFuncType {
        let mut results = self.results.iter();
        // The ret value is the first result (if there is one), passed
        // by value.
        let ret = results.next().map(|param| {
            param
                .pass_by_value()
                .expect("validation ensures first result can be passed by value")
        });
        let args = self
            .params
            .iter()
            .flat_map(|param| {
                // interface function parameters are passed by value if possible,
                // and fall back on passing by reference.
                param
                    .pass_by_value()
                    .map(|ptype| vec![ptype])
                    .unwrap_or_else(|| param.pass_by_reference())
            })
            // Then, the remaining results are passed by reference.
            .chain(results.flat_map(|param| param.pass_by_reference()))
            .collect();
        CoreFuncType { args, ret }
    }
/// Get the WebAssembly type signature for this interface function
Get the WebAssembly type signature for this interface function
Get the WebAssembly type signature for this interface function
pub fn core_type(&self) -> CoreFuncType {
        let mut results = self.results.iter();
        // The ret value is the first result (if there is one), passed
        // by value.
        let ret = results.next().map(|param| {
            param
                .pass_by_value()
                .expect("validation ensures first result can be passed by value")
        });
        let args = self
            .params
            .iter()
            .flat_map(|param| {
                // interface function parameters are passed by value if possible,
                // and fall back on passing by reference.
                param
                    .pass_by_value()
                    .map(|ptype| vec![ptype])
                    .unwrap_or_else(|| param.pass_by_reference())
            })
            // Then, the remaining results are passed by reference.
            .chain(results.flat_map(|param| param.pass_by_reference()))
            .collect();
        CoreFuncType { args, ret }
    }
pub fn core_type ( & self ) -> CoreFuncType { let mut results = self . results . iter ( ) ; // The ret value is the first result (if there is one), passed // by value. let ret = results . next ( ) . map ( | param | { param . pass_by_value ( ) . expect ( " " ) } ) ; let args = self . params . iter ( ) . flat_map ( | param | { // interface function parameters are passed by value if possible, // and fall back on passing by reference. param . pass_by_value ( ) . map ( | ptype | vec ! [ ptype ] ) . unwrap_or_else ( | | param . pass_by_reference ( ) ) } ) // Then, the remaining results are passed by reference. . chain ( results . flat_map ( | param | param . pass_by_reference ( ) ) ) . collect ( ) ; CoreFuncType { args , ret } }
Get the WebAssembly type signature for this interface function
Get the WebAssembly type signature for this interface function
&self
&self