Delegate ValueDecoder<TState, T>
- Namespace
- RocksDbNet
- Assembly
- RocksDb.Net.dll
Turns a value read from the database into a T,
reading it in place, with state passed in rather than captured.
public delegate T ValueDecoder<in TState, T>(ReadOnlySpan<byte> value, TState state)
Parameters
valueReadOnlySpan<byte>The value, pointing into RocksDb's own memory. Valid only until the decoder returns.
stateTStateThe state passed alongside the decoder.
Returns
- T
The decoded value.
Type Parameters
TStateThe state the decoder needs, such as serializer options.
TWhat the value decodes to.
Remarks
The form to use when the decoder needs something from its surroundings. A
lambda that captures it allocates a closure on every call; one that takes
it as state can be static and allocates nothing.
The same pattern as Create<TState>(int, TState, SpanAction<char, TState>).