github.com/dolthub/dolt/go@v0.40.5-0.20240520175717-68db7794bea6/gen/fb/serial/stat.go (about) 1 // Copyright 2022-2023 Dolthub, Inc. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 // Code generated by the FlatBuffers compiler. DO NOT EDIT. 16 17 package serial 18 19 import ( 20 flatbuffers "github.com/dolthub/flatbuffers/v23/go" 21 ) 22 23 type Statistic struct { 24 _tab flatbuffers.Table 25 } 26 27 func InitStatisticRoot(o *Statistic, buf []byte, offset flatbuffers.UOffsetT) error { 28 n := flatbuffers.GetUOffsetT(buf[offset:]) 29 return o.Init(buf, n+offset) 30 } 31 32 func TryGetRootAsStatistic(buf []byte, offset flatbuffers.UOffsetT) (*Statistic, error) { 33 x := &Statistic{} 34 return x, InitStatisticRoot(x, buf, offset) 35 } 36 37 func TryGetSizePrefixedRootAsStatistic(buf []byte, offset flatbuffers.UOffsetT) (*Statistic, error) { 38 x := &Statistic{} 39 return x, InitStatisticRoot(x, buf, offset+flatbuffers.SizeUint32) 40 } 41 42 func (rcv *Statistic) Init(buf []byte, i flatbuffers.UOffsetT) error { 43 rcv._tab.Bytes = buf 44 rcv._tab.Pos = i 45 if StatisticNumFields < rcv.Table().NumFields() { 46 return flatbuffers.ErrTableHasUnknownFields 47 } 48 return nil 49 } 50 51 func (rcv *Statistic) Table() flatbuffers.Table { 52 return rcv._tab 53 } 54 55 func (rcv *Statistic) Root(j int) byte { 56 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 57 if o != 0 { 58 a := rcv._tab.Vector(o) 59 return rcv._tab.GetByte(a + flatbuffers.UOffsetT(j*1)) 60 } 61 return 0 62 } 63 64 func (rcv *Statistic) RootLength() int { 65 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 66 if o != 0 { 67 return rcv._tab.VectorLen(o) 68 } 69 return 0 70 } 71 72 func (rcv *Statistic) RootBytes() []byte { 73 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 74 if o != 0 { 75 return rcv._tab.ByteVector(o + rcv._tab.Pos) 76 } 77 return nil 78 } 79 80 func (rcv *Statistic) MutateRoot(j int, n byte) bool { 81 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 82 if o != 0 { 83 a := rcv._tab.Vector(o) 84 return rcv._tab.MutateByte(a+flatbuffers.UOffsetT(j*1), n) 85 } 86 return false 87 } 88 89 const StatisticNumFields = 1 90 91 func StatisticStart(builder *flatbuffers.Builder) { 92 builder.StartObject(StatisticNumFields) 93 } 94 func StatisticAddRoot(builder *flatbuffers.Builder, root flatbuffers.UOffsetT) { 95 builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(root), 0) 96 } 97 func StatisticStartRootVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT { 98 return builder.StartVector(1, numElems, 1) 99 } 100 func StatisticEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 101 return builder.EndObject() 102 }