@@ -14,6 +14,7 @@ pub(super) fn is_virtual_host_namespace_spec(spec: &str) -> bool {
1414 is_ident_start ( first) && chars. all ( is_ident_continue)
1515}
1616
17+ #[ cfg( feature = "edge-abi" ) ]
1718fn abi_value_type_to_value_type ( value : edge_abi:: AbiValueType ) -> ValueType {
1819 match value {
1920 edge_abi:: AbiValueType :: Unknown => ValueType :: Unknown ,
@@ -29,15 +30,25 @@ fn abi_value_type_to_value_type(value: edge_abi::AbiValueType) -> ValueType {
2930}
3031
3132fn known_host_return_type ( name : & str ) -> ValueType {
32- edge_abi:: function_by_name ( name)
33- . map ( |function| abi_value_type_to_value_type ( function. return_type ) )
33+ edge_host_return_type ( name)
3434 . or_else ( || {
3535 default_host_callable ( name)
3636 . and_then ( |callable| parse_host_return_value_type ( callable. signature . return_type ) )
3737 } )
3838 . unwrap_or ( ValueType :: Unknown )
3939}
4040
41+ #[ cfg( feature = "edge-abi" ) ]
42+ fn edge_host_return_type ( name : & str ) -> Option < ValueType > {
43+ edge_abi:: function_by_name ( name)
44+ . map ( |function| abi_value_type_to_value_type ( function. return_type ) )
45+ }
46+
47+ #[ cfg( not( feature = "edge-abi" ) ) ]
48+ fn edge_host_return_type ( _name : & str ) -> Option < ValueType > {
49+ None
50+ }
51+
4152fn known_host_return_schema ( name : & str ) -> Option < TypeSchema > {
4253 default_host_callable ( name)
4354 . and_then ( |callable| parse_host_return_schema ( callable. signature . return_type ) )
@@ -102,6 +113,7 @@ fn parse_simple_host_return_schema(spec: &str) -> Option<TypeSchema> {
102113}
103114
104115fn known_host_accepts_arity ( name : & str , arity : u8 ) -> bool {
116+ #[ cfg( feature = "edge-abi" ) ]
105117 if let Some ( function) = edge_abi:: function_by_name ( name) {
106118 return function. param_types . len ( ) == usize:: from ( arity) ;
107119 }
0 commit comments