Iter returns a new iterator that yields key/value pairs sorted by keys. It doesn't allocate.
()
| 151 | // |
| 152 | // It doesn't allocate. |
| 153 | func (m Metadata) Iter() iter.Seq2[string, string] { |
| 154 | return func(yield func(string, string) bool) { |
| 155 | for sub := range m.Divide() { |
| 156 | k, v, _ := stringsCut(sub.Encode()[1:], metadataKVSeparator) |
| 157 | if !yield(k, v) { |
| 158 | return |
| 159 | } |
| 160 | } |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | // Set a key value pair. |
| 165 | // |