Table of Contents

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

value ReadOnlySpan<byte>

The value, pointing into RocksDb's own memory. Valid only until the decoder returns.

state TState

The state passed alongside the decoder.

Returns

T

The decoded value.

Type Parameters

TState

The state the decoder needs, such as serializer options.

T

What 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>).