List is a zero-indexed, ordered list. The element [Value] type is determined by [FieldDescriptor.Kind]. Providing a [Value] that is invalid or of an incorrect type panics.
| 178 | // The element [Value] type is determined by [FieldDescriptor.Kind]. |
| 179 | // Providing a [Value] that is invalid or of an incorrect type panics. |
| 180 | type List interface { |
| 181 | // Len reports the number of entries in the List. |
| 182 | // Get, Set, and Truncate panic with out of bound indexes. |
| 183 | Len() int |
| 184 | |
| 185 | // Get retrieves the value at the given index. |
| 186 | // It never returns an invalid value. |
| 187 | Get(int) Value |
| 188 | |
| 189 | // Set stores a value for the given index. |
| 190 | // When setting a composite type, it is unspecified whether the set |
| 191 | // value aliases the source's memory in any way. |
| 192 | // |
| 193 | // Set is a mutating operation and unsafe for concurrent use. |
| 194 | Set(int, Value) |
| 195 | |
| 196 | // Append appends the provided value to the end of the list. |
| 197 | // When appending a composite type, it is unspecified whether the appended |
| 198 | // value aliases the source's memory in any way. |
| 199 | // |
| 200 | // Append is a mutating operation and unsafe for concurrent use. |
| 201 | Append(Value) |
| 202 | |
| 203 | // AppendMutable appends a new, empty, mutable message value to the end |
| 204 | // of the list and returns it. |
| 205 | // It panics if the list does not contain a message type. |
| 206 | AppendMutable() Value |
| 207 | |
| 208 | // Truncate truncates the list to a smaller length. |
| 209 | // |
| 210 | // Truncate is a mutating operation and unsafe for concurrent use. |
| 211 | Truncate(int) |
| 212 | |
| 213 | // NewElement returns a new value for a list element. |
| 214 | // For enums, this returns the first enum value. |
| 215 | // For other scalars, this returns the zero value. |
| 216 | // For messages, this returns a new, empty, mutable value. |
| 217 | NewElement() Value |
| 218 | |
| 219 | // IsValid reports whether the list is valid. |
| 220 | // |
| 221 | // An invalid list is an empty, read-only value. |
| 222 | // |
| 223 | // Validity is not part of the protobuf data model, and may not |
| 224 | // be preserved in marshaling or other operations. |
| 225 | IsValid() bool |
| 226 | } |
| 227 | |
| 228 | // Map is an unordered, associative map. |
| 229 | // The entry [MapKey] type is determined by [FieldDescriptor.MapKey].Kind. |
no outgoing calls
no test coverage detected