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);
58 * Constructs a new LightningError given each field
60 public static LightningError of(string err_arg, org.ldk.structs.ErrorAction action_arg) {
61 long ret = bindings.LightningError_new(err_arg, action_arg.ptr);
62 GC.KeepAlive(err_arg);
63 GC.KeepAlive(action_arg);
64 if (ret >= 0 && ret <= 4096) { return null; }
65 org.ldk.structs.LightningError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.LightningError(null, ret); }
66 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
70 internal long clone_ptr() {
71 long ret = bindings.LightningError_clone_ptr(this.ptr);
77 * Creates a copy of the LightningError
79 public LightningError clone() {
80 long ret = bindings.LightningError_clone(this.ptr);
82 if (ret >= 0 && ret <= 4096) { return null; }
83 org.ldk.structs.LightningError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.LightningError(null, ret); }
84 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };