mirror of
https://github.com/denoland/deno.git
synced 2025-08-02 18:12:39 +00:00
Rename flatbuffer base.msg to base.inner
This better disambiguates with the msg_generated.ts module, which in JS we call "fbs", but would be better called "msg".
This commit is contained in:
parent
51dc46eff4
commit
f774953011
21 changed files with 204 additions and 204 deletions
|
@ -39,12 +39,12 @@ export function handleAsyncMsgFromRust(ui8: Uint8Array) {
|
|||
// @internal
|
||||
export function sendAsync(
|
||||
builder: flatbuffers.Builder,
|
||||
msgType: fbs.Any,
|
||||
msg: flatbuffers.Offset,
|
||||
innerType: fbs.Any,
|
||||
inner: flatbuffers.Offset,
|
||||
data?: ArrayBufferView
|
||||
): Promise<fbs.Base> {
|
||||
maybePushTrace(msgType, false); // add to trace if tracing
|
||||
const [cmdId, resBuf] = sendInternal(builder, msgType, msg, data, false);
|
||||
maybePushTrace(innerType, false); // add to trace if tracing
|
||||
const [cmdId, resBuf] = sendInternal(builder, innerType, inner, data, false);
|
||||
util.assert(resBuf == null);
|
||||
const promise = util.createResolvable<fbs.Base>();
|
||||
promiseTable.set(cmdId, promise);
|
||||
|
@ -54,12 +54,12 @@ export function sendAsync(
|
|||
// @internal
|
||||
export function sendSync(
|
||||
builder: flatbuffers.Builder,
|
||||
msgType: fbs.Any,
|
||||
msg: flatbuffers.Offset,
|
||||
innerType: fbs.Any,
|
||||
inner: flatbuffers.Offset,
|
||||
data?: ArrayBufferView
|
||||
): null | fbs.Base {
|
||||
maybePushTrace(msgType, true); // add to trace if tracing
|
||||
const [cmdId, resBuf] = sendInternal(builder, msgType, msg, data, true);
|
||||
maybePushTrace(innerType, true); // add to trace if tracing
|
||||
const [cmdId, resBuf] = sendInternal(builder, innerType, inner, data, true);
|
||||
util.assert(cmdId >= 0);
|
||||
if (resBuf == null) {
|
||||
return null;
|
||||
|
@ -74,15 +74,15 @@ export function sendSync(
|
|||
|
||||
function sendInternal(
|
||||
builder: flatbuffers.Builder,
|
||||
msgType: fbs.Any,
|
||||
msg: flatbuffers.Offset,
|
||||
innerType: fbs.Any,
|
||||
inner: flatbuffers.Offset,
|
||||
data: undefined | ArrayBufferView,
|
||||
sync = true
|
||||
): [number, null | Uint8Array] {
|
||||
const cmdId = nextCmdId++;
|
||||
fbs.Base.startBase(builder);
|
||||
fbs.Base.addMsg(builder, msg);
|
||||
fbs.Base.addMsgType(builder, msgType);
|
||||
fbs.Base.addInner(builder, inner);
|
||||
fbs.Base.addInnerType(builder, innerType);
|
||||
fbs.Base.addSync(builder, sync);
|
||||
fbs.Base.addCmdId(builder, cmdId);
|
||||
builder.finish(fbs.Base.endBase(builder));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue