1
2
3
4
5 package a
6
7 import (
8 "reflect"
9 "sync"
10 )
11
12 type addressableValue struct{ reflect.Value }
13
14 type arshalers[Options, Coder any] struct {
15 fncVals []typedArshaler[Options, Coder]
16 fncCache sync.Map
17 }
18 type typedArshaler[Options, Coder any] struct {
19 typ reflect.Type
20 fnc func(Options, *Coder, addressableValue) error
21 }
22
23 type UnmarshalOptions1 struct {
24
25 Unmarshalers *arshalers[UnmarshalOptions1, Decoder1]
26 }
27
28 type Decoder1 struct {
29 }
30
31 func (a *arshalers[Options, Coder]) lookup(fnc func(Options, *Coder, addressableValue) error, t reflect.Type) func(Options, *Coder, addressableValue) error {
32 return fnc
33 }
34
35 func UnmarshalFuncV2[T any](fn func(UnmarshalOptions1, *Decoder1, T) error) *arshalers[UnmarshalOptions1, Decoder1] {
36 return &arshalers[UnmarshalOptions1, Decoder1]{}
37 }
38
View as plain text