args,meta: add a Len()

This commit is contained in:
Michael Muré
2024-12-12 16:06:01 +01:00
parent 042d6dc52f
commit 416345dba9
4 changed files with 18 additions and 0 deletions

View File

@@ -192,6 +192,11 @@ func (m *Meta) Include(other Iterator) {
}
}
// Len returns the number of key/values.
func (m *Meta) Len() int {
return len(m.Values)
}
// Iter iterates over the meta key/values
func (m *Meta) Iter() iter.Seq2[string, ipld.Node] {
return func(yield func(string, ipld.Node) bool) {