6 namespace org { namespace ldk { namespace structs {
8 public class Result_NonePaymentSendFailureZ : CommonBase {
9 Result_NonePaymentSendFailureZ(object _dummy, long ptr) : base(ptr) { }
10 ~Result_NonePaymentSendFailureZ() {
11 if (ptr != 0) { bindings.CResult_NonePaymentSendFailureZ_free(ptr); }
14 internal static Result_NonePaymentSendFailureZ constr_from_ptr(long ptr) {
15 if (bindings.CResult_NonePaymentSendFailureZ_is_ok(ptr)) {
16 return new Result_NonePaymentSendFailureZ_OK(null, ptr);
18 return new Result_NonePaymentSendFailureZ_Err(null, ptr);
21 public class Result_NonePaymentSendFailureZ_OK : Result_NonePaymentSendFailureZ {
22 internal Result_NonePaymentSendFailureZ_OK(object _dummy, long ptr) : base(_dummy, ptr) {
26 public class Result_NonePaymentSendFailureZ_Err : Result_NonePaymentSendFailureZ {
27 public readonly PaymentSendFailure err;
28 internal Result_NonePaymentSendFailureZ_Err(object _dummy, long ptr) : base(_dummy, ptr) {
29 long err = bindings.CResult_NonePaymentSendFailureZ_get_err(ptr);
30 org.ldk.structs.PaymentSendFailure err_hu_conv = org.ldk.structs.PaymentSendFailure.constr_from_ptr(err);
31 if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); };
32 this.err = err_hu_conv;
37 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
39 public static Result_NonePaymentSendFailureZ ok() {
40 long ret = bindings.CResult_NonePaymentSendFailureZ_ok();
41 if (ret >= 0 && ret <= 4096) { return null; }
42 Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret);
47 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
49 public static Result_NonePaymentSendFailureZ err(org.ldk.structs.PaymentSendFailure e) {
50 long ret = bindings.CResult_NonePaymentSendFailureZ_err(e.ptr);
52 if (ret >= 0 && ret <= 4096) { return null; }
53 Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret);
58 * Checks if the given object is currently in the success state
61 bool ret = bindings.CResult_NonePaymentSendFailureZ_is_ok(this.ptr);
66 internal long clone_ptr() {
67 long ret = bindings.CResult_NonePaymentSendFailureZ_clone_ptr(this.ptr);
73 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
74 * but with all dynamically-allocated buffers duplicated in new buffers.
76 public Result_NonePaymentSendFailureZ clone() {
77 long ret = bindings.CResult_NonePaymentSendFailureZ_clone(this.ptr);
79 if (ret >= 0 && ret <= 4096) { return null; }
80 Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret);