lightningdevkit
Version:
Lightning Development Kit
57 lines • 2.75 kB
JavaScript
import { TwoTuple__u1632_u1632Z } from '../structs/TwoTuple__u1632_u1632Z.mjs';
import { CommonBase } from './CommonBase.mjs';
import * as bindings from '../bindings.mjs';
/**
* An enum which can either contain a crate::c_types::derived::C2Tuple__u1632_u1632Z or not
*/
export class Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ extends CommonBase {
constructor(_dummy, ptr) { super(ptr, bindings.COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_free); }
/* @internal */
static constr_from_ptr(ptr) {
const raw_ty = bindings.LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_ty_from_ptr(ptr);
switch (raw_ty) {
case 0: return new Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Some(ptr);
case 1: return new Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_None(ptr);
default:
throw new Error('oops, this should be unreachable'); // Unreachable without extending the (internal) bindings interface
}
}
/**
* Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing a crate::c_types::derived::C2Tuple__u1632_u1632Z
*/
static constructor_some(o) {
const ret = bindings.COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_some(CommonBase.get_ptr_of(o));
const ret_hu_conv = Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
CommonBase.add_ref_from(ret_hu_conv, o);
return ret_hu_conv;
}
/**
* Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing nothing
*/
static constructor_none() {
const ret = bindings.COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_none();
const ret_hu_conv = Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
return ret_hu_conv;
}
}
/** A Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ of type Some */
export class Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Some extends Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ {
/* @internal */
constructor(ptr) {
super(null, ptr);
const some = bindings.LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Some_get_some(ptr);
const some_hu_conv = new TwoTuple__u1632_u1632Z(null, some);
CommonBase.add_ref_from(some_hu_conv, this);
this.some = some_hu_conv;
}
}
/** A Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ of type None */
export class Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_None extends Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ {
/* @internal */
constructor(ptr) {
super(null, ptr);
}
}
//# sourceMappingURL=Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.mjs.map