File: trees.go

package info (click to toggle)
golang-github-kentik-patricia 1.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,860 kB
  • sloc: makefile: 54
file content (35 lines) | stat: -rw-r--r-- 880 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Code generated by automation. DO NOT EDIT

package generics_tree

// code common to the IPv4/IPv6 trees

// MatchesFunc[T] is called to check if tag data matches the input value
type MatchesFunc[T any] func(payload T, val T) bool

// FilterFunc[T] is called on each result to see if it belongs in the resulting set
type FilterFunc[T any] func(payload T) bool

// UpdatesFunc[T] is called to update the tag value
type UpdatesFunc[T any] func(payload T) T

// treeIteratorNext is an indicator to know what Next() should return
// for the current node.
type treeIteratorNext int

const (
	nextSelf treeIteratorNext = iota
	nextLeft
	nextRight
	nextUp
)

// deleteNodeResult is the return type for deleteNode() function
type deleteNodeResult int

const (
	notDeleted deleteNodeResult = iota
	deletedNodeReplacedByChild
	deletedNodeParentReplacedBySibling
	deletedNodeJustRemoved
)