X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FResult_CVec_u8ZPeerHandleErrorZ.ts;h=e4ff80b48a1500329977c4511b1f022f2b9d574d;hb=f3e670e9341decac613d33fc52febf19cea32f20;hp=c0d1f1f074cff2dbf0bd8e2ef7f23e6e9337efa0;hpb=822471992c6bf6f9985e531cc5940e4cc35e3e4c;p=ldk-java diff --git a/ts/structs/Result_CVec_u8ZPeerHandleErrorZ.ts b/ts/structs/Result_CVec_u8ZPeerHandleErrorZ.ts index c0d1f1f0..e4ff80b4 100644 --- a/ts/structs/Result_CVec_u8ZPeerHandleErrorZ.ts +++ b/ts/structs/Result_CVec_u8ZPeerHandleErrorZ.ts @@ -9,34 +9,57 @@ public class Result_CVec_u8ZPeerHandleErrorZ extends CommonBase { } static Result_CVec_u8ZPeerHandleErrorZ constr_from_ptr(long ptr) { - if (bindings.LDKCResult_CVec_u8ZPeerHandleErrorZ_result_ok(ptr)) { + if (bindings.CResult_CVec_u8ZPeerHandleErrorZ_is_ok(ptr)) { return new Result_CVec_u8ZPeerHandleErrorZ_OK(null, ptr); } else { return new Result_CVec_u8ZPeerHandleErrorZ_Err(null, ptr); } } public static final class Result_CVec_u8ZPeerHandleErrorZ_OK extends Result_CVec_u8ZPeerHandleErrorZ { - public final byte[] res; + public final Uint8Array res; private Result_CVec_u8ZPeerHandleErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); this.res = bindings.LDKCResult_CVec_u8ZPeerHandleErrorZ_get_ok(ptr); } - public Result_CVec_u8ZPeerHandleErrorZ_OK(byte[] res) { - this(null, bindings.CResult_CVec_u8ZPeerHandleErrorZ_ok(res)); - } } public static final class Result_CVec_u8ZPeerHandleErrorZ_Err extends Result_CVec_u8ZPeerHandleErrorZ { public final PeerHandleError err; private Result_CVec_u8ZPeerHandleErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_CVec_u8ZPeerHandleErrorZ_get_err(ptr); - PeerHandleError err_hu_conv = new PeerHandleError(null, err); + number err = bindings.LDKCResult_CVec_u8ZPeerHandleErrorZ_get_err(ptr); + const err_hu_conv: PeerHandleError = new PeerHandleError(null, err); + err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; } - public Result_CVec_u8ZPeerHandleErrorZ_Err(PeerHandleError err) { - this(null, bindings.CResult_CVec_u8ZPeerHandleErrorZ_err(err == null ? 0 : err.ptr & ~1)); - this.ptrs_to.add(err); - } } + + public static Result_CVec_u8ZPeerHandleErrorZ constructor_ok(Uint8Array o) { + number ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_ok(o); + Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public static Result_CVec_u8ZPeerHandleErrorZ constructor_err(PeerHandleError e) { + number ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_err(e == null ? 0 : e.ptr & ~1); + Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + public boolean is_ok() { + boolean ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_is_ok(this.ptr); + return ret; + } + + public number clone_ptr() { + number ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(this.ptr); + return ret; + } + + public Result_CVec_u8ZPeerHandleErrorZ clone() { + number ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_clone(this.ptr); + Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + }