transporttrie

package
v0.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IterateRaw added in v0.0.40

func IterateRaw(r io.Reader, buf []byte, cb func(k []byte, v int)) error

IterateRaw iterates through the serialized trie and calls cb function for every leaf. k references bytes from buf, therefore it must not be modified or used outside of cb, a copy of k should be used instead.

Types

type Trie

type Trie struct {
	I byte // debugging

	Multiplier int
	Divider    int
	// contains filtered or unexported fields
}

func Deserialize

func Deserialize(r io.Reader) (*Trie, error)

func FromBytes

func FromBytes(p []byte) *Trie

func New

func New() *Trie

New returns a new initialized empty Trie.

func (*Trie) Bytes

func (t *Trie) Bytes() []byte

func (*Trie) Clone

func (t *Trie) Clone(m, d int) *Trie

func (*Trie) Diff added in v0.0.30

func (originalTrie *Trie) Diff(srcTrie *Trie) *Trie

func (*Trie) Insert

func (t *Trie) Insert(key []byte, value uint64, merge ...bool)

func (*Trie) IsEmpty added in v0.0.38

func (t *Trie) IsEmpty() bool

func (*Trie) Iterate

func (t *Trie) Iterate(cb func(name []byte, val uint64))

func (*Trie) Merge

func (dstTrie *Trie) Merge(srcTrieI merge.Merger)

func (*Trie) Serialize

func (t *Trie) Serialize(w io.Writer) error

func (*Trie) String

func (t *Trie) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL