if (ptr != 0) { bindings.CResult_PendingHTLCInfoInboundHTLCErrZ_free(ptr); } super.finalize();
}
+ protected void force_free() {
+ if (ptr != 0) { bindings.CResult_PendingHTLCInfoInboundHTLCErrZ_free(ptr); ptr = 0; }
+ }
+
static Result_PendingHTLCInfoInboundHTLCErrZ constr_from_ptr(long ptr) {
if (bindings.CResult_PendingHTLCInfoInboundHTLCErrZ_is_ok(ptr)) {
return new Result_PendingHTLCInfoInboundHTLCErrZ_OK(null, ptr);
* Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ in the success state.
*/
public static Result_PendingHTLCInfoInboundHTLCErrZ ok(org.ldk.structs.PendingHTLCInfo o) {
- long ret = bindings.CResult_PendingHTLCInfoInboundHTLCErrZ_ok(o == null ? 0 : o.ptr);
+ long ret = bindings.CResult_PendingHTLCInfoInboundHTLCErrZ_ok(o.ptr);
Reference.reachabilityFence(o);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PendingHTLCInfoInboundHTLCErrZ ret_hu_conv = Result_PendingHTLCInfoInboundHTLCErrZ.constr_from_ptr(ret);
/**
* Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ in the error state.
*/
- public static Result_PendingHTLCInfoInboundHTLCErrZ err(short e_err_code_arg, byte[] e_err_data_arg, String e_msg_arg) {
- long ret = bindings.CResult_PendingHTLCInfoInboundHTLCErrZ_err(bindings.InboundHTLCErr_new(e_err_code_arg, e_err_data_arg, e_msg_arg));
- Reference.reachabilityFence(e_err_code_arg);
- Reference.reachabilityFence(e_err_data_arg);
- Reference.reachabilityFence(e_msg_arg);
+ public static Result_PendingHTLCInfoInboundHTLCErrZ err(org.ldk.structs.InboundHTLCErr e) {
+ long ret = bindings.CResult_PendingHTLCInfoInboundHTLCErrZ_err(e.ptr);
+ Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PendingHTLCInfoInboundHTLCErrZ ret_hu_conv = Result_PendingHTLCInfoInboundHTLCErrZ.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
return ret;
}
+ long clone_ptr() {
+ long ret = bindings.CResult_PendingHTLCInfoInboundHTLCErrZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ /**
+ * Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+ public Result_PendingHTLCInfoInboundHTLCErrZ clone() {
+ long ret = bindings.CResult_PendingHTLCInfoInboundHTLCErrZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_PendingHTLCInfoInboundHTLCErrZ ret_hu_conv = Result_PendingHTLCInfoInboundHTLCErrZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
}