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

Method ReadData

go/fory/pointer.go:254–265  ·  view source on GitHub ↗
(ctx *ReadContext, value reflect.Value)

Source from the content-addressed store, hash-verified

252}
253
254func (s *ptrToInterfaceSerializer) ReadData(ctx *ReadContext, value reflect.Value) {
255 // Create a new interface pointer
256 newVal := reflect.New(value.Type().Elem())
257
258 // Use ReadValue to handle the polymorphic interface value with ref tracking and type info
259 ctx.ReadValue(newVal.Elem(), RefModeTracking, true)
260 if ctx.HasError() {
261 return
262 }
263
264 value.Set(newVal)
265}
266
267func (s *ptrToInterfaceSerializer) Read(ctx *ReadContext, refMode RefMode, readType bool, hasGenerics bool, value reflect.Value) {
268 buf := ctx.Buffer()

Callers 1

ReadMethod · 0.95

Calls 4

ReadValueMethod · 0.80
TypeMethod · 0.45
HasErrorMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected