6 namespace org { namespace ldk { namespace structs {
8 public class Result_ChannelShutdownStateDecodeErrorZ : CommonBase {
9 Result_ChannelShutdownStateDecodeErrorZ(object _dummy, long ptr) : base(ptr) { }
10 ~Result_ChannelShutdownStateDecodeErrorZ() {
11 if (ptr != 0) { bindings.CResult_ChannelShutdownStateDecodeErrorZ_free(ptr); }
14 internal static Result_ChannelShutdownStateDecodeErrorZ constr_from_ptr(long ptr) {
15 if (bindings.CResult_ChannelShutdownStateDecodeErrorZ_is_ok(ptr)) {
16 return new Result_ChannelShutdownStateDecodeErrorZ_OK(null, ptr);
18 return new Result_ChannelShutdownStateDecodeErrorZ_Err(null, ptr);
21 public class Result_ChannelShutdownStateDecodeErrorZ_OK : Result_ChannelShutdownStateDecodeErrorZ {
22 public readonly ChannelShutdownState res;
23 internal Result_ChannelShutdownStateDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) {
24 this.res = bindings.CResult_ChannelShutdownStateDecodeErrorZ_get_ok(ptr);
28 public class Result_ChannelShutdownStateDecodeErrorZ_Err : Result_ChannelShutdownStateDecodeErrorZ {
29 public readonly DecodeError err;
30 internal Result_ChannelShutdownStateDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) {
31 long err = bindings.CResult_ChannelShutdownStateDecodeErrorZ_get_err(ptr);
32 org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
33 if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); };
34 this.err = err_hu_conv;
39 * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the success state.
41 public static Result_ChannelShutdownStateDecodeErrorZ ok(ChannelShutdownState o) {
42 long ret = bindings.CResult_ChannelShutdownStateDecodeErrorZ_ok(o);
44 if (ret >= 0 && ret <= 4096) { return null; }
45 Result_ChannelShutdownStateDecodeErrorZ ret_hu_conv = Result_ChannelShutdownStateDecodeErrorZ.constr_from_ptr(ret);
50 * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the error state.
52 public static Result_ChannelShutdownStateDecodeErrorZ err(org.ldk.structs.DecodeError e) {
53 long ret = bindings.CResult_ChannelShutdownStateDecodeErrorZ_err(e.ptr);
55 if (ret >= 0 && ret <= 4096) { return null; }
56 Result_ChannelShutdownStateDecodeErrorZ ret_hu_conv = Result_ChannelShutdownStateDecodeErrorZ.constr_from_ptr(ret);
57 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); };
62 * Checks if the given object is currently in the success state
65 bool ret = bindings.CResult_ChannelShutdownStateDecodeErrorZ_is_ok(this.ptr);
70 internal long clone_ptr() {
71 long ret = bindings.CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr(this.ptr);
77 * Creates a new CResult_ChannelShutdownStateDecodeErrorZ which has the same data as `orig`
78 * but with all dynamically-allocated buffers duplicated in new buffers.
80 public Result_ChannelShutdownStateDecodeErrorZ clone() {
81 long ret = bindings.CResult_ChannelShutdownStateDecodeErrorZ_clone(this.ptr);
83 if (ret >= 0 && ret <= 4096) { return null; }
84 Result_ChannelShutdownStateDecodeErrorZ ret_hu_conv = Result_ChannelShutdownStateDecodeErrorZ.constr_from_ptr(ret);