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 string ret = bindings.LightningError_get_err(this.ptr);
28 * A human-readable message describing the error
30 public void set_err(string val) {
31 bindings.LightningError_set_err(this.ptr, val);
37 * The action which should be taken against the offending peer.
39 public ErrorAction get_action() {
40 long ret = bindings.LightningError_get_action(this.ptr);
42 if (ret >= 0 && ret <= 4096) { return null; }
43 org.ldk.structs.ErrorAction ret_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(ret);
44 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
49 * The action which should be taken against the offending peer.
51 public void set_action(org.ldk.structs.ErrorAction val) {
52 bindings.LightningError_set_action(this.ptr, val.ptr);
55 if (this != null) { this.ptrs_to.AddLast(val); };
59 * Constructs a new LightningError given each field
61 public static LightningError of(string err_arg, org.ldk.structs.ErrorAction action_arg) {
62 long ret = bindings.LightningError_new(err_arg, action_arg.ptr);
63 GC.KeepAlive(err_arg);
64 GC.KeepAlive(action_arg);
65 if (ret >= 0 && ret <= 4096) { return null; }
66 org.ldk.structs.LightningError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.LightningError(null, ret); }
67 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
68 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(action_arg); };
72 internal long clone_ptr() {
73 long ret = bindings.LightningError_clone_ptr(this.ptr);
79 * Creates a copy of the LightningError
81 public LightningError clone() {
82 long ret = bindings.LightningError_clone(this.ptr);
84 if (ret >= 0 && ret <= 4096) { return null; }
85 org.ldk.structs.LightningError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.LightningError(null, ret); }
86 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };