ValueEncoderExtensions

Namespace: SnowBank.Data.Binary · class

Extension methods for working with value encoders

Methods

DecodeValues

static TValue[] DecodeValues<TValue, TStorage>(IValueEncoder<TValue, TStorage> encoder, params TStorage[] values)

Decodes a span of TStorage into an array of TValue

static TValue[] DecodeValues<TValue, TStorage>(IValueEncoder<TValue, TStorage> encoder, ReadOnlySpan<TStorage> values)

Decodes an array of TStorage into an array of TValue

static TValue[] DecodeValues<TValue, TStorage, TAny>(IValueEncoder<TValue, TStorage> encoder, IEnumerable<KeyValuePair<TAny, TStorage>> items)

Decodes the values from a sequence of Key/Value pairs into a list of TValue, discarding the keys in the process.

static TValue[] DecodeValues<TValue, TStorage>(IValueEncoder<TValue, TStorage> encoder, IEnumerable<TStorage> values)

Decodes a sequence of TStorage into a list of TValue

static TValue[] DecodeValues<TValue, TStorage, TElement>(IValueEncoder<TValue, TStorage> encoder, IEnumerable<TElement> items, Func<TElement, TStorage> selector)

Decodes a sequence of items into a list of TValue by extracting one field using the specified selector

EncodeValues

static TStorage[] EncodeValues<TValue, TStorage>(IValueEncoder<TValue, TStorage> encoder, params TValue[] values)

Encodes an array of TValue into an array of TStorage

static TStorage[] EncodeValues<TValue, TStorage>(IValueEncoder<TValue, TStorage> encoder, ReadOnlySpan<TValue> values)

Encodes a span of TValue into an array of TStorage

static List<TStorage> EncodeValues<TValue, TStorage>(IValueEncoder<TValue, TStorage> encoder, IEnumerable<TValue> values)

Encodes the values of a sequence of Key/Value pairs into a list of TStorage, discarding the keys in the process

static List<TStorage> EncodeValues<TValue, TStorage, TElement>(IValueEncoder<TValue, TStorage> encoder, IEnumerable<TElement> items, Func<TElement, TValue> selector)

Encodes a sequence of items into a list of TStorage by extracting one field using the specified selector

SelectValues

static IEnumerable<TStorage> SelectValues<TValue, TStorage>(IValueEncoder<TValue, TStorage> encoder, IEnumerable<TValue> values)

Transforms a sequence of TValue into a sequence of TStorage

static IEnumerable<TStorage> SelectValues<TValue, TStorage, TAny>(IValueEncoder<TValue, TStorage> encoder, IEnumerable<KeyValuePair<TAny, TValue>> items)

Transforms the values a sequence of Key/Value pairs into a sequence of TStorage, discarding the keys in the process

static IEnumerable<TValue> SelectValues<TValue, TStorage>(IValueEncoder<TValue, TStorage> encoder, IEnumerable<TStorage> values)

Transforms a sequence of slices back into a sequence of TValues, using a serializer (or the default serializer if none is provided)

static IEnumerable<TValue> SelectValues<TValue, TStorage, TAny>(IValueEncoder<TValue, TStorage> encoder, IEnumerable<KeyValuePair<TAny, TStorage>> items)

Transforms the values from a sequence of Key/Value pairs, into another sequence of TValue, discarding the keys in the process.

static IEnumerable<TStorage> SelectValues<TValue, TStorage, TElement>(IValueEncoder<TValue, TStorage> encoder, IEnumerable<TElement> items, Func<TElement, TValue> selector)

Transforms a sequence of items into a sequence of TStorage by extracting one field using the specified selector

static IEnumerable<TValue> SelectValues<TValue, TStorage, TElement>(IValueEncoder<TValue, TStorage> encoder, IEnumerable<TElement> items, Func<TElement, TStorage> selector)

Transform a sequence of items into another sequence of TValue by extracting one field using the specified selector