Struct Iterator.Enumerator
- Namespace
- RocksDbNet
- Assembly
- RocksDb.Net.dll
Walks an iterator without allocating, yielding spans that point straight at the iterator's buffers.
public ref struct Iterator.Enumerator
- Inherited Members
Remarks
A ref struct, so it cannot be boxed, stored in a
field, or used across an await. That is deliberate:
the spans it hands out are only valid until the iterator moves, and
those restrictions are what stop one outliving its data.
Properties
Current
The current entry. Invalidated by the next MoveNext().
public Iterator.Entry Current { get; }
Property Value
Remarks
Present so foreach works. Without a Current the
pattern is not satisfied and foreach (var e in iterator) did
not compile, despite GetEnumerator() claiming to return
an enumerator over the collection.
CurrentKey
The current key. Invalidated by the next MoveNext().
public ReadOnlySpan<byte> CurrentKey { get; }
Property Value
CurrentValue
The current value. Invalidated by the next MoveNext().
public ReadOnlySpan<byte> CurrentValue { get; }
Property Value
Methods
MoveNext()
Advances to the next entry.
public bool MoveNext()