6 namespace org { namespace ldk { namespace structs {
10 * An Err type for failure to process messages.
12 public class LightningError : CommonBase {
13 internal LightningError(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.LightningError_free(ptr); }
19 * A human-readable message describing the error
21 public string get_err() {
22 long ret = bindings.LightningError_get_err(this.ptr);
24 if (ret >= 0 && ret <= 4096) { return null; }
25 string ret_conv = InternalUtils.decodeString(ret);
30 * A human-readable message describing the error
32 public void set_err(string val) {
33 bindings.LightningError_set_err(this.ptr, InternalUtils.encodeString(val));
39 * The action which should be taken against the offending peer.
41 public ErrorAction get_action() {
42 long ret = bindings.LightningError_get_action(this.ptr);
44 if (ret >= 0 && ret <= 4096) { return null; }
45 org.ldk.structs.ErrorAction ret_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(ret);
46 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
51 * The action which should be taken against the offending peer.
53 public void set_action(org.ldk.structs.ErrorAction val) {
54 bindings.LightningError_set_action(this.ptr, val.ptr);
57 if (this != null) { this.ptrs_to.AddLast(val); };
61 * Constructs a new LightningError given each field
63 public static LightningError of(string err_arg, org.ldk.structs.ErrorAction action_arg) {
64 long ret = bindings.LightningError_new(InternalUtils.encodeString(err_arg), action_arg.ptr);
65 GC.KeepAlive(err_arg);
66 GC.KeepAlive(action_arg);
67 if (ret >= 0 && ret <= 4096) { return null; }
68 org.ldk.structs.LightningError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.LightningError(null, ret); }
69 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
70 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(action_arg); };
74 internal long clone_ptr() {
75 long ret = bindings.LightningError_clone_ptr(this.ptr);
81 * Creates a copy of the LightningError
83 public LightningError clone() {
84 long ret = bindings.LightningError_clone(this.ptr);
86 if (ret >= 0 && ret <= 4096) { return null; }
87 org.ldk.structs.LightningError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.LightningError(null, ret); }
88 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };