MCPcopy Create free account
hub / github.com/segmentio/encoding / Size

Function Size

proto/proto.go:10–14  ·  view source on GitHub ↗
(v any)

Source from the content-addressed store, hash-verified

8)
9
10func Size(v any) int {
11 t, p := inspect(v)
12 c := cachedCodecOf(t)
13 return c.size(p, inline|toplevel)
14}
15
16func Marshal(v any) ([]byte, error) {
17 t, p := inspect(v)

Callers 4

BenchmarkEncodeMessageFunction · 0.85
BenchmarkEncodeMapFunction · 0.85
BenchmarkEncodeSliceFunction · 0.85
TestMarshalUnmarshalFunction · 0.85

Calls 2

inspectFunction · 0.85
cachedCodecOfFunction · 0.85

Tested by 4

BenchmarkEncodeMessageFunction · 0.68
BenchmarkEncodeMapFunction · 0.68
BenchmarkEncodeSliceFunction · 0.68
TestMarshalUnmarshalFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…