2 import CommonBase from './CommonBase';
3 import * as bindings from '../bindings' // TODO: figure out location
5 public class Result_TxOutAccessErrorZ extends CommonBase {
6 private Result_TxOutAccessErrorZ(Object _dummy, long ptr) { super(ptr); }
7 protected void finalize() throws Throwable {
8 if (ptr != 0) { bindings.CResult_TxOutAccessErrorZ_free(ptr); } super.finalize();
11 static Result_TxOutAccessErrorZ constr_from_ptr(long ptr) {
12 if (bindings.LDKCResult_TxOutAccessErrorZ_result_ok(ptr)) {
13 return new Result_TxOutAccessErrorZ_OK(null, ptr);
15 return new Result_TxOutAccessErrorZ_Err(null, ptr);
18 public static final class Result_TxOutAccessErrorZ_OK extends Result_TxOutAccessErrorZ {
19 public final TxOut res;
20 private Result_TxOutAccessErrorZ_OK(Object _dummy, long ptr) {
22 number res = bindings.LDKCResult_TxOutAccessErrorZ_get_ok(ptr);
23 TxOut res_conv = new TxOut(null, res);
26 public Result_TxOutAccessErrorZ_OK(TxOut res) {
27 this(null, bindings.CResult_TxOutAccessErrorZ_ok(res.ptr));
31 public static final class Result_TxOutAccessErrorZ_Err extends Result_TxOutAccessErrorZ {
32 public final LDKAccessError err;
33 private Result_TxOutAccessErrorZ_Err(Object _dummy, long ptr) {
35 this.err = bindings.LDKCResult_TxOutAccessErrorZ_get_err(ptr);
37 public Result_TxOutAccessErrorZ_Err(LDKAccessError err) {
38 this(null, bindings.CResult_TxOutAccessErrorZ_err(err));