- ret_ty_info = type_mapping_generator.map_type(fn_line.group(2).strip() + " ret", True, None, False, False)
- is_const = fn_line.group(4) is not None
-
- arg_tys = []
- for idx, arg in enumerate(fn_line.group(5).split(',')):
- if arg == "":
- continue
- arg_conv_info = type_mapping_generator.map_type(arg, True, None, False, False)
- arg_tys.append(arg_conv_info)
- field_fns.append(TraitMethInfo(fn_line.group(3), is_const, ret_ty_info, arg_tys, fn_docs))
+ if fn_line == "cloned":
+ ret_ty_info = type_mapping_generator.map_type("void", True, None, False, False)
+ field_fns.append(TraitMethInfo("cloned", False, ret_ty_info, [], fn_docs))
+ else:
+ ret_ty_info = type_mapping_generator.map_type(fn_line.group(2).strip() + " ret", True, None, False, False)
+ is_const = fn_line.group(4) is not None
+ (nullable_params, ret_nullable) = doc_to_params_ret_nullable(fn_docs)
+ if ret_nullable:
+ assert False # This isn't yet handled on the Java side
+ ret_ty_info.nullable = True
+
+ arg_tys = []
+ for idx, arg in enumerate(fn_line.group(5).split(',')):
+ if arg == "":
+ continue
+ arg_conv_info = type_mapping_generator.map_type(arg, True, None, False, False)
+ if arg_conv_info.arg_name in nullable_params:
+ # Types that are actually null instead of all-0s aren't yet handled on the Java side:
+ assert arg_conv_info.rust_obj == "LDKPublicKey"
+ arg_conv_info.nullable = True
+ arg_tys.append(arg_conv_info)
+ field_fns.append(TraitMethInfo(fn_line.group(3), is_const, ret_ty_info, arg_tys, fn_docs))