6 namespace org { namespace ldk { namespace structs {
8 public class Result_InFlightHtlcsDecodeErrorZ : CommonBase {
9 Result_InFlightHtlcsDecodeErrorZ(object _dummy, long ptr) : base(ptr) { }
10 ~Result_InFlightHtlcsDecodeErrorZ() {
11 if (ptr != 0) { bindings.CResult_InFlightHtlcsDecodeErrorZ_free(ptr); }
14 internal static Result_InFlightHtlcsDecodeErrorZ constr_from_ptr(long ptr) {
15 if (bindings.CResult_InFlightHtlcsDecodeErrorZ_is_ok(ptr)) {
16 return new Result_InFlightHtlcsDecodeErrorZ_OK(null, ptr);
18 return new Result_InFlightHtlcsDecodeErrorZ_Err(null, ptr);
21 public class Result_InFlightHtlcsDecodeErrorZ_OK : Result_InFlightHtlcsDecodeErrorZ {
22 public readonly InFlightHtlcs res;
23 internal Result_InFlightHtlcsDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) {
24 long res = bindings.CResult_InFlightHtlcsDecodeErrorZ_get_ok(ptr);
25 org.ldk.structs.InFlightHtlcs res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.InFlightHtlcs(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_InFlightHtlcsDecodeErrorZ_Err : Result_InFlightHtlcsDecodeErrorZ {
32 public readonly DecodeError err;
33 internal Result_InFlightHtlcsDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) {
34 long err = bindings.CResult_InFlightHtlcsDecodeErrorZ_get_err(ptr);
35 org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(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_InFlightHtlcsDecodeErrorZ in the success state.
44 public static Result_InFlightHtlcsDecodeErrorZ ok(org.ldk.structs.InFlightHtlcs o) {
45 long ret = bindings.CResult_InFlightHtlcsDecodeErrorZ_ok(o == null ? 0 : o.ptr);
47 if (ret >= 0 && ret <= 4096) { return null; }
48 Result_InFlightHtlcsDecodeErrorZ ret_hu_conv = Result_InFlightHtlcsDecodeErrorZ.constr_from_ptr(ret);
49 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); };
54 * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the error state.
56 public static Result_InFlightHtlcsDecodeErrorZ err(org.ldk.structs.DecodeError e) {
57 long ret = bindings.CResult_InFlightHtlcsDecodeErrorZ_err(e.ptr);
59 if (ret >= 0 && ret <= 4096) { return null; }
60 Result_InFlightHtlcsDecodeErrorZ ret_hu_conv = Result_InFlightHtlcsDecodeErrorZ.constr_from_ptr(ret);
65 * Checks if the given object is currently in the success state
68 bool ret = bindings.CResult_InFlightHtlcsDecodeErrorZ_is_ok(this.ptr);
73 internal long clone_ptr() {
74 long ret = bindings.CResult_InFlightHtlcsDecodeErrorZ_clone_ptr(this.ptr);
80 * Creates a new CResult_InFlightHtlcsDecodeErrorZ which has the same data as `orig`
81 * but with all dynamically-allocated buffers duplicated in new buffers.
83 public Result_InFlightHtlcsDecodeErrorZ clone() {
84 long ret = bindings.CResult_InFlightHtlcsDecodeErrorZ_clone(this.ptr);
86 if (ret >= 0 && ret <= 4096) { return null; }
87 Result_InFlightHtlcsDecodeErrorZ ret_hu_conv = Result_InFlightHtlcsDecodeErrorZ.constr_from_ptr(ret);