6 namespace org { namespace ldk { namespace structs {
8 public class Result_u32GraphSyncErrorZ : CommonBase {
9 Result_u32GraphSyncErrorZ(object _dummy, long ptr) : base(ptr) { }
10 ~Result_u32GraphSyncErrorZ() {
11 if (ptr != 0) { bindings.CResult_u32GraphSyncErrorZ_free(ptr); }
14 internal static Result_u32GraphSyncErrorZ constr_from_ptr(long ptr) {
15 if (bindings.CResult_u32GraphSyncErrorZ_is_ok(ptr)) {
16 return new Result_u32GraphSyncErrorZ_OK(null, ptr);
18 return new Result_u32GraphSyncErrorZ_Err(null, ptr);
21 public class Result_u32GraphSyncErrorZ_OK : Result_u32GraphSyncErrorZ {
22 public readonly int res;
23 internal Result_u32GraphSyncErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) {
24 this.res = bindings.CResult_u32GraphSyncErrorZ_get_ok(ptr);
28 public class Result_u32GraphSyncErrorZ_Err : Result_u32GraphSyncErrorZ {
29 public readonly GraphSyncError err;
30 internal Result_u32GraphSyncErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) {
31 long err = bindings.CResult_u32GraphSyncErrorZ_get_err(ptr);
32 org.ldk.structs.GraphSyncError err_hu_conv = org.ldk.structs.GraphSyncError.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_u32GraphSyncErrorZ in the success state.
41 public static Result_u32GraphSyncErrorZ ok(int o) {
42 long ret = bindings.CResult_u32GraphSyncErrorZ_ok(o);
44 if (ret >= 0 && ret <= 4096) { return null; }
45 Result_u32GraphSyncErrorZ ret_hu_conv = Result_u32GraphSyncErrorZ.constr_from_ptr(ret);
50 * Creates a new CResult_u32GraphSyncErrorZ in the error state.
52 public static Result_u32GraphSyncErrorZ err(org.ldk.structs.GraphSyncError e) {
53 long ret = bindings.CResult_u32GraphSyncErrorZ_err(e.ptr);
55 if (ret >= 0 && ret <= 4096) { return null; }
56 Result_u32GraphSyncErrorZ ret_hu_conv = Result_u32GraphSyncErrorZ.constr_from_ptr(ret);
61 * Checks if the given object is currently in the success state
64 bool ret = bindings.CResult_u32GraphSyncErrorZ_is_ok(this.ptr);