~bigbes/tarantool

tarantool-protobuf

ref: 53840866a6ef3349d42bf589a6646aaad6869386 tarantool-protobuf/examples/expected/runtime/c_int64/c_int64_pb.lua -rw-r--r-- 2.1 KiB
53840866 — Eugene Blikh codegen: emit <Msg>_decode_unsafe for trusted-source decoding (6bb) 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
-- Code generated by protoc-gen-tarantool. DO NOT EDIT.
-- source: c_int64.proto
-- syntax: proto3
-- package: c_int64

local pb = require("pb")
local wire = pb.wire
local string_byte = string.byte
local utf8_len = require('utf8').len
local band = bit.band
local rshift = bit.rshift
local CHARS = wire.CHARS
local table_new = require('table.new')

local M = {}

M.options = {go_package = "tarantoolpb_synthetic/c_int64"}

-- Pre-declare message descriptors so cross-references resolve.
M.Wide_descriptor = {name = "c_int64.Wide"}

-- Message: c_int64.Wide
M.Wide_descriptor.fields = {
    {name="a_int64", id=1, kind='scalar', proto_type="int64"},
    {name="a_uint64", id=2, kind='scalar', proto_type="uint64"},
    {name="a_sint64", id=3, kind='scalar', proto_type="sint64"},
    {name="a_fixed64", id=4, kind='scalar', proto_type="fixed64"},
    {name="a_sfixed64", id=5, kind='scalar', proto_type="sfixed64"},
}
pb.finalize_message(M.Wide_descriptor)
M.Wide_fields = pb.field_names({
    a_int64 = "a_int64",
    a_uint64 = "a_uint64",
    a_sint64 = "a_sint64",
    a_fixed64 = "a_fixed64",
    a_sfixed64 = "a_sfixed64",
})

-- EmmyLua / lua-language-server type annotations.
-- These are comments — no runtime effect. They give editors
-- autocomplete and type-checking for the generated wrappers.
---@class c_int64.Wide
---@field a_int64 integer
---@field a_uint64 integer
---@field a_sint64 integer
---@field a_fixed64 integer
---@field a_sfixed64 integer

---@param t? c_int64.Wide
---@return c_int64.Wide
function M.Wide_new(t) return t or {} end
---@param t c_int64.Wide
---@return string
function M.Wide_encode(t) return pb.encode(M.Wide_descriptor, t) end
---@param b string
---@return c_int64.Wide
function M.Wide_decode(b) return pb.decode(M.Wide_descriptor, b) end
---@param b string
---@return pb.MessageView
function M.Wide_decode_lazy(b) return pb.decode_lazy(M.Wide_descriptor, b) end
---@param t c_int64.Wide
---@param opts? {single_line: boolean?, indent: string?}
---@return string
function M.Wide_text(t, opts) return pb.text.encode(M.Wide_descriptor, t, opts) end

return M