6 namespace org { namespace ldk { namespace structs {
8 public class Result_PendingHTLCInfoInboundHTLCErrZ : CommonBase {
9 Result_PendingHTLCInfoInboundHTLCErrZ(object _dummy, long ptr) : base(ptr) { }
10 ~Result_PendingHTLCInfoInboundHTLCErrZ() {
11 if (ptr != 0) { bindings.CResult_PendingHTLCInfoInboundHTLCErrZ_free(ptr); }
14 internal static Result_PendingHTLCInfoInboundHTLCErrZ constr_from_ptr(long ptr) {
15 if (bindings.CResult_PendingHTLCInfoInboundHTLCErrZ_is_ok(ptr)) {
16 return new Result_PendingHTLCInfoInboundHTLCErrZ_OK(null, ptr);
18 return new Result_PendingHTLCInfoInboundHTLCErrZ_Err(null, ptr);
21 public class Result_PendingHTLCInfoInboundHTLCErrZ_OK : Result_PendingHTLCInfoInboundHTLCErrZ {
22 public readonly PendingHTLCInfo res;
23 internal Result_PendingHTLCInfoInboundHTLCErrZ_OK(object _dummy, long ptr) : base(_dummy, ptr) {
24 long res = bindings.CResult_PendingHTLCInfoInboundHTLCErrZ_get_ok(ptr);
25 org.ldk.structs.PendingHTLCInfo res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.PendingHTLCInfo(null, res); }
26 if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); };
27 this.res = res_hu_conv;
31 public class Result_PendingHTLCInfoInboundHTLCErrZ_Err : Result_PendingHTLCInfoInboundHTLCErrZ {
32 public readonly InboundHTLCErr err;
33 internal Result_PendingHTLCInfoInboundHTLCErrZ_Err(object _dummy, long ptr) : base(_dummy, ptr) {
34 long err = bindings.CResult_PendingHTLCInfoInboundHTLCErrZ_get_err(ptr);
35 org.ldk.structs.InboundHTLCErr err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.InboundHTLCErr(null, err); }
36 if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); };
37 this.err = err_hu_conv;
42 * Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ in the success state.
44 public static Result_PendingHTLCInfoInboundHTLCErrZ ok(org.ldk.structs.PendingHTLCInfo o) {
45 long ret = bindings.CResult_PendingHTLCInfoInboundHTLCErrZ_ok(o == null ? 0 : o.ptr);
47 if (ret >= 0 && ret <= 4096) { return null; }
48 Result_PendingHTLCInfoInboundHTLCErrZ ret_hu_conv = Result_PendingHTLCInfoInboundHTLCErrZ.constr_from_ptr(ret);
49 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); };
54 * Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ in the error state.
56 public static Result_PendingHTLCInfoInboundHTLCErrZ err(short e_err_code_arg, byte[] e_err_data_arg, string e_msg_arg) {
57 long ret = bindings.CResult_PendingHTLCInfoInboundHTLCErrZ_err(bindings.InboundHTLCErr_new(e_err_code_arg, InternalUtils.encodeUint8Array(e_err_data_arg), InternalUtils.encodeString(e_msg_arg)));
58 GC.KeepAlive(e_err_code_arg);
59 GC.KeepAlive(e_err_data_arg);
60 GC.KeepAlive(e_msg_arg);
61 if (ret >= 0 && ret <= 4096) { return null; }
62 Result_PendingHTLCInfoInboundHTLCErrZ ret_hu_conv = Result_PendingHTLCInfoInboundHTLCErrZ.constr_from_ptr(ret);
69 * Checks if the given object is currently in the success state
72 bool ret = bindings.CResult_PendingHTLCInfoInboundHTLCErrZ_is_ok(this.ptr);