Table of Contents

Struct MergeOperands

Namespace
RocksDbNet
Assembly
RocksDb.Net.dll

The operands of a merge, read in place from RocksDb's memory.

public readonly ref struct MergeOperands
Inherited Members

Remarks

A ref struct because the memory it reads belongs to the merge in progress: RocksDb builds the operand arrays as locals of the call and they are gone when it returns. The compiler therefore stops it being stored in a field, captured, or kept past the callback, which is the mistake the copying overloads exist to make safe. Copy an operand with ToArray() if it has to outlive the call.

Operands are in chronological order, oldest first.

Properties

Count

The number of operands.

public int Count { get; }

Property Value

int

this[int]

The operand at index, valid for the duration of the callback.

public ReadOnlySpan<byte> this[int index] { get; }

Parameters

index int

Property Value

ReadOnlySpan<byte>

Exceptions

ArgumentOutOfRangeException

index is out of range.

Methods

ToArrays()

Copies every operand into a managed array.

public byte[][] ToArrays()

Returns

byte[][]