import * as bindings from '../bindings.mjs'
+/**
+ * A pong message to be sent or received from a peer
+ */
export class Pong extends CommonBase {
/* @internal */
public constructor(_dummy: object, ptr: number) {
super(ptr, bindings.Pong_free);
}
+ /**
+ * The pong packet size.
+ * This field is not sent on the wire. byteslen zeros are sent.
+ */
public get_byteslen(): number {
const ret: number = bindings.Pong_get_byteslen(this.ptr);
return ret;
}
+ /**
+ * The pong packet size.
+ * This field is not sent on the wire. byteslen zeros are sent.
+ */
public set_byteslen(val: number): void {
bindings.Pong_set_byteslen(this.ptr, val);
}
+ /**
+ * Constructs a new Pong given each field
+ */
public static constructor_new(byteslen_arg: number): Pong {
const ret: number = bindings.Pong_new(byteslen_arg);
const ret_hu_conv: Pong = new Pong(null, ret);
return ret;
}
+ /**
+ * Creates a copy of the Pong
+ */
public clone(): Pong {
const ret: number = bindings.Pong_clone(this.ptr);
const ret_hu_conv: Pong = new Pong(null, ret);
return ret_hu_conv;
}
+ /**
+ * Serialize the Pong object into a byte array which can be read by Pong_read
+ */
public write(): Uint8Array {
const ret: number = bindings.Pong_write(this.ptr);
const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
return ret_conv;
}
+ /**
+ * Read a Pong from a byte array, created by Pong_write
+ */
public static constructor_read(ser: Uint8Array): Result_PongDecodeErrorZ {
const ret: number = bindings.Pong_read(bindings.encodeUint8Array(ser));
const ret_hu_conv: Result_PongDecodeErrorZ = Result_PongDecodeErrorZ.constr_from_ptr(ret);