6 namespace org { namespace ldk { namespace structs {
9 * Indicates that we failed to send a payment probe. Further errors may be surfaced later via
10 * [`Event::ProbeFailed`].
12 * [`Event::ProbeFailed`]: crate::events::Event::ProbeFailed
14 public class ProbeSendFailure : CommonBase {
15 protected ProbeSendFailure(object _dummy, long ptr) : base(ptr) { }
17 if (ptr != 0) { bindings.ProbeSendFailure_free(ptr); }
20 internal static ProbeSendFailure constr_from_ptr(long ptr) {
21 long raw_ty = bindings.LDKProbeSendFailure_ty_from_ptr(ptr);
23 case 0: return new ProbeSendFailure_RouteNotFound(ptr);
24 case 1: return new ProbeSendFailure_SendingFailed(ptr);
26 throw new ArgumentException("Impossible enum variant");
30 /** A ProbeSendFailure of type RouteNotFound */
31 public class ProbeSendFailure_RouteNotFound : ProbeSendFailure {
32 internal ProbeSendFailure_RouteNotFound(long ptr) : base(null, ptr) {
35 /** A ProbeSendFailure of type SendingFailed */
36 public class ProbeSendFailure_SendingFailed : ProbeSendFailure {
37 public PaymentSendFailure sending_failed;
38 internal ProbeSendFailure_SendingFailed(long ptr) : base(null, ptr) {
39 long sending_failed = bindings.LDKProbeSendFailure_SendingFailed_get_sending_failed(ptr);
40 org.ldk.structs.PaymentSendFailure sending_failed_hu_conv = org.ldk.structs.PaymentSendFailure.constr_from_ptr(sending_failed);
41 if (sending_failed_hu_conv != null) { sending_failed_hu_conv.ptrs_to.AddLast(this); };
42 this.sending_failed = sending_failed_hu_conv;
45 internal long clone_ptr() {
46 long ret = bindings.ProbeSendFailure_clone_ptr(this.ptr);
52 * Creates a copy of the ProbeSendFailure
54 public ProbeSendFailure clone() {
55 long ret = bindings.ProbeSendFailure_clone(this.ptr);
57 if (ret >= 0 && ret <= 4096) { return null; }
58 org.ldk.structs.ProbeSendFailure ret_hu_conv = org.ldk.structs.ProbeSendFailure.constr_from_ptr(ret);
59 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
64 * Utility method to constructs a new RouteNotFound-variant ProbeSendFailure
66 public static ProbeSendFailure route_not_found() {
67 long ret = bindings.ProbeSendFailure_route_not_found();
68 if (ret >= 0 && ret <= 4096) { return null; }
69 org.ldk.structs.ProbeSendFailure ret_hu_conv = org.ldk.structs.ProbeSendFailure.constr_from_ptr(ret);
70 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
75 * Utility method to constructs a new SendingFailed-variant ProbeSendFailure
77 public static ProbeSendFailure sending_failed(org.ldk.structs.PaymentSendFailure a) {
78 long ret = bindings.ProbeSendFailure_sending_failed(a.ptr);
80 if (ret >= 0 && ret <= 4096) { return null; }
81 org.ldk.structs.ProbeSendFailure ret_hu_conv = org.ldk.structs.ProbeSendFailure.constr_from_ptr(ret);
82 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
83 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); };
88 * Checks if two ProbeSendFailures contain equal inner contents.
89 * This ignores pointers and is_owned flags and looks at the values in fields.
91 public bool eq(org.ldk.structs.ProbeSendFailure b) {
92 bool ret = bindings.ProbeSendFailure_eq(this.ptr, b == null ? 0 : b.ptr);
98 public override bool Equals(object o) {
99 if (!(o is ProbeSendFailure)) return false;
100 return this.eq((ProbeSendFailure)o);