types.gno
0.58 Kb · 39 lines
1package btree
2
3type key interface {
4 Less(than key) bool
5}
6
7type stringKey string
8
9var _ key = (stringKey)("")
10
11func (s stringKey) Less(than key) bool {
12 return s < than.(stringKey)
13}
14
15type uint32Key uint32
16
17var _ key = (uint32Key)(0)
18
19func (u uint32Key) Less(than key) bool {
20 return u < than.(uint32Key)
21}
22
23type uint64Key uint64
24
25var _ key = (uint64Key)(0)
26
27func (u uint64Key) Less(than key) bool {
28 return u < than.(uint64Key)
29}
30
31type int64Key int64
32
33var _ key = (int64Key)(0)
34
35func (u int64Key) Less(than key) bool {
36 return u < than.(int64Key)
37}
38
39type iterCbFn func(key key, value any) bool