6 namespace org { namespace ldk { namespace structs {
8 public class Result_ThirtyTwoBytesPaymentErrorZ : CommonBase {
9 Result_ThirtyTwoBytesPaymentErrorZ(object _dummy, long ptr) : base(ptr) { }
10 ~Result_ThirtyTwoBytesPaymentErrorZ() {
11 if (ptr != 0) { bindings.CResult_ThirtyTwoBytesPaymentErrorZ_free(ptr); }
14 internal static Result_ThirtyTwoBytesPaymentErrorZ constr_from_ptr(long ptr) {
15 if (bindings.CResult_ThirtyTwoBytesPaymentErrorZ_is_ok(ptr)) {
16 return new Result_ThirtyTwoBytesPaymentErrorZ_OK(null, ptr);
18 return new Result_ThirtyTwoBytesPaymentErrorZ_Err(null, ptr);
21 public class Result_ThirtyTwoBytesPaymentErrorZ_OK : Result_ThirtyTwoBytesPaymentErrorZ {
22 public readonly byte[] res;
23 internal Result_ThirtyTwoBytesPaymentErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) {
24 long res = bindings.CResult_ThirtyTwoBytesPaymentErrorZ_get_ok(ptr);
25 byte[] res_conv = InternalUtils.decodeUint8Array(res);
30 public class Result_ThirtyTwoBytesPaymentErrorZ_Err : Result_ThirtyTwoBytesPaymentErrorZ {
31 public readonly PaymentError err;
32 internal Result_ThirtyTwoBytesPaymentErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) {
33 long err = bindings.CResult_ThirtyTwoBytesPaymentErrorZ_get_err(ptr);
34 org.ldk.structs.PaymentError err_hu_conv = org.ldk.structs.PaymentError.constr_from_ptr(err);
35 if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); };
36 this.err = err_hu_conv;
41 * Creates a new CResult_ThirtyTwoBytesPaymentErrorZ in the success state.
43 public static Result_ThirtyTwoBytesPaymentErrorZ ok(byte[] o) {
44 long ret = bindings.CResult_ThirtyTwoBytesPaymentErrorZ_ok(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(o, 32)));
46 if (ret >= 0 && ret <= 4096) { return null; }
47 Result_ThirtyTwoBytesPaymentErrorZ ret_hu_conv = Result_ThirtyTwoBytesPaymentErrorZ.constr_from_ptr(ret);
52 * Creates a new CResult_ThirtyTwoBytesPaymentErrorZ in the error state.
54 public static Result_ThirtyTwoBytesPaymentErrorZ err(org.ldk.structs.PaymentError e) {
55 long ret = bindings.CResult_ThirtyTwoBytesPaymentErrorZ_err(e.ptr);
57 if (ret >= 0 && ret <= 4096) { return null; }
58 Result_ThirtyTwoBytesPaymentErrorZ ret_hu_conv = Result_ThirtyTwoBytesPaymentErrorZ.constr_from_ptr(ret);
59 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); };
64 * Checks if the given object is currently in the success state
67 bool ret = bindings.CResult_ThirtyTwoBytesPaymentErrorZ_is_ok(this.ptr);
72 internal long clone_ptr() {
73 long ret = bindings.CResult_ThirtyTwoBytesPaymentErrorZ_clone_ptr(this.ptr);
79 * Creates a new CResult_ThirtyTwoBytesPaymentErrorZ which has the same data as `orig`
80 * but with all dynamically-allocated buffers duplicated in new buffers.
82 public Result_ThirtyTwoBytesPaymentErrorZ clone() {
83 long ret = bindings.CResult_ThirtyTwoBytesPaymentErrorZ_clone(this.ptr);
85 if (ret >= 0 && ret <= 4096) { return null; }
86 Result_ThirtyTwoBytesPaymentErrorZ ret_hu_conv = Result_ThirtyTwoBytesPaymentErrorZ.constr_from_ptr(ret);