lightningdevkit
Version:
Lightning Development Kit
63 lines • 3.01 kB
JavaScript
import { DecodeError } from '../structs/DecodeError.mjs';
import { TwoTuple_ThirtyTwoBytesChannelManagerZ } from '../structs/TwoTuple_ThirtyTwoBytesChannelManagerZ.mjs';
import { CommonBase } from './CommonBase.mjs';
import * as bindings from '../bindings.mjs';
export class Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ extends CommonBase {
constructor(_dummy, ptr) {
super(ptr, bindings.CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_free);
}
/* @internal */
static constr_from_ptr(ptr) {
if (bindings.CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_is_ok(ptr)) {
return new Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_OK(null, ptr);
}
else {
return new Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_Err(null, ptr);
}
}
/**
* Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the success state.
*/
static constructor_ok(o) {
const ret = bindings.CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_ok(CommonBase.get_ptr_of(o));
const ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, o);
return ret_hu_conv;
}
/**
* Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the error state.
*/
static constructor_err(e) {
const ret = bindings.CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_err(CommonBase.get_ptr_of(e));
const ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.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_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_is_ok(this.ptr);
return ret;
}
}
export class Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_OK extends Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ {
/* @internal */
constructor(_dummy, ptr) {
super(_dummy, ptr);
const res = bindings.CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_get_ok(ptr);
const res_hu_conv = new TwoTuple_ThirtyTwoBytesChannelManagerZ(null, res);
CommonBase.add_ref_from(res_hu_conv, this);
this.res = res_hu_conv;
}
}
export class Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_Err extends Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ {
/* @internal */
constructor(_dummy, ptr) {
super(_dummy, ptr);
const err = bindings.CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_get_err(ptr);
const err_hu_conv = DecodeError.constr_from_ptr(err);
CommonBase.add_ref_from(err_hu_conv, this);
this.err = err_hu_conv;
}
}
//# sourceMappingURL=Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.mjs.map