UNPKG

lightningdevkit

Version:
68 lines 2.2 kB
import { CommonBase } from './CommonBase.mjs'; import * as bindings from '../bindings.mjs'; export class Result__u832NoneZ extends CommonBase { constructor(_dummy, ptr) { super(ptr, bindings.CResult__u832NoneZ_free); } /* @internal */ static constr_from_ptr(ptr) { if (bindings.CResult__u832NoneZ_is_ok(ptr)) { return new Result__u832NoneZ_OK(null, ptr); } else { return new Result__u832NoneZ_Err(null, ptr); } } /** * Creates a new CResult__u832NoneZ in the success state. */ static constructor_ok(o) { const ret = bindings.CResult__u832NoneZ_ok(bindings.encodeUint8Array(o)); const ret_hu_conv = Result__u832NoneZ.constr_from_ptr(ret); return ret_hu_conv; } /** * Creates a new CResult__u832NoneZ in the error state. */ static constructor_err() { const ret = bindings.CResult__u832NoneZ_err(); const ret_hu_conv = Result__u832NoneZ.constr_from_ptr(ret); return ret_hu_conv; } /** * Checks if the given object is currently in the success state */ is_ok() { const ret = bindings.CResult__u832NoneZ_is_ok(this.ptr); return ret; } clone_ptr() { const ret = bindings.CResult__u832NoneZ_clone_ptr(this.ptr); return ret; } /** * Creates a new CResult__u832NoneZ which has the same data as `orig` * but with all dynamically-allocated buffers duplicated in new buffers. */ clone() { const ret = bindings.CResult__u832NoneZ_clone(this.ptr); const ret_hu_conv = Result__u832NoneZ.constr_from_ptr(ret); return ret_hu_conv; } } export class Result__u832NoneZ_OK extends Result__u832NoneZ { /* @internal */ constructor(_dummy, ptr) { super(_dummy, ptr); const res = bindings.CResult__u832NoneZ_get_ok(ptr); const res_conv = bindings.decodeUint8Array(res); this.res = res_conv; } } export class Result__u832NoneZ_Err extends Result__u832NoneZ { /* @internal */ constructor(_dummy, ptr) { super(_dummy, ptr); } } //# sourceMappingURL=Result__u832NoneZ.mjs.map