LinksSize is the bytes used to store navigable links within a node. For example, here is snippet of code for calculating linksSize for a ProtoNode:
type ProtoNode struct {
links []*format.Link
data []byte
// cache encoded/marshaled value
encoded *immutableProtoNode
cached cid.Cid
// builder specifies cid version and hashing function
builder cid.Builder
}
func (n *ProtoNode) Stat() (*format.NodeStat, error) {
enc, err := n.EncodeProtobuf(false)
if err != nil {
return nil, err
}
cumSize, err := n.Size()
if err != nil {
return nil, err
}
return &format.NodeStat{
Hash: n.Cid().String(),
NumLinks: len(n.links),
BlockSize: len(enc),
LinksSize: len(enc) - len(n.data), // includes framing.
DataSize: len(n.data),
CumulativeSize: int(cumSize),
}, nil
}