Documentation ¶
Overview ¶
Package dbiter provides the interal DB iterator implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Iterator ¶
type Iterator[T any] interface { // Key returns the key at the index of the iterator. // The returned key is immutable and must not be changed! // // A mutable key can be retrieved by cloning the key. Key() typact.Option[rel.Key] // Value returns the value at the index of the iterator., // The returned value is immutable and must not be changed! // // A mutable value can be retrieved by cloning the value. Value() typact.Option[[]byte] Next() bool IsValid() bool }
Iterator defines the methods of a iterator.
type MergeIterator ¶
type MergeIterator[T any] struct { // contains filtered or unexported fields }
MergeIterator is an iterator over multiple iterators. If the same key occurs multiple times in some iterators, the one with the smalest indx is prefered.
func NewMergeIterator ¶
func NewMergeIterator[T any](iters ...Iterator[T]) *MergeIterator[T]
NewMergeIterator returns an initialized MergeIterator.
func (*MergeIterator[T]) IsValid ¶
func (m *MergeIterator[T]) IsValid() bool
IsValid returns whether the current iterator in m is valid.
func (*MergeIterator[T]) Next ¶
func (m *MergeIterator[T]) Next() bool
Next moves over to the next element in the iterator. If the next element could be retrieved, true is returned. Otherwise false is returned.
Click to show internal directories.
Click to hide internal directories.