MCPcopy Create free account
hub / github.com/apache/fory / NeedWriteRef

Function NeedWriteRef

go/fory/types.go:206–215  ·  view source on GitHub ↗

NeedWriteRef returns whether a type with the given type ID needs reference tracking. Primitive types, strings, and time types don't need reference tracking. Collections, structs, and other complex types need reference tracking.

(typeID TypeId)

Source from the content-addressed store, hash-verified

204// Primitive types, strings, and time types don't need reference tracking.
205// Collections, structs, and other complex types need reference tracking.
206func NeedWriteRef(typeID TypeId) bool {
207 switch typeID {
208 case BOOL, INT8, INT16, INT32, INT64, VARINT32, VARINT64, TAGGED_INT64,
209 FLOAT32, FLOAT64, FLOAT16, FLOAT8, BFLOAT16,
210 STRING, TIMESTAMP, DATE, DURATION, DECIMAL, NONE:
211 return false
212 default:
213 return true
214 }
215}
216
217func isListType(typeID TypeId) bool {
218 return typeID == LIST

Callers 5

registerTypeMethod · 0.85
fieldDeclaredTrackRefFunction · 0.85
enforceTopLevelFlagsFunction · 0.85
inferTrackRefFunction · 0.85
applyHintModifiersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected