Class IceEncoderExtensions
Provides extension methods for IceEncoder to encode sequences or dictionaries.
public static class IceEncoderExtensions
- Inheritance
-
IceEncoderExtensions
- Inherited Members
Methods
EncodeDictionary<TKey, TValue>(ref IceEncoder, IEnumerable<KeyValuePair<TKey, TValue>>, EncodeAction<TKey>, EncodeAction<TValue>)
Encodes a dictionary.
public static void EncodeDictionary<TKey, TValue>(this ref IceEncoder encoder, IEnumerable<KeyValuePair<TKey, TValue>> v, EncodeAction<TKey> keyEncodeAction, EncodeAction<TValue> valueEncodeAction) where TKey : notnull
Parameters
encoderIceEncoderThe Ice encoder.
vIEnumerable<KeyValuePair<TKey, TValue>>The dictionary to encode.
keyEncodeActionEncodeAction<TKey>The encode action for the keys.
valueEncodeActionEncodeAction<TValue>The encode action for the values.
Type Parameters
TKeyThe dictionary key type.
TValueThe dictionary value type.
EncodeSequence<T>(ref IceEncoder, IEnumerable<T>)
Encodes a sequence of fixed-size numeric values, such as int or ulong.
public static void EncodeSequence<T>(this ref IceEncoder encoder, IEnumerable<T> v) where T : struct
Parameters
encoderIceEncoderThe Ice encoder.
vIEnumerable<T>The sequence of numeric values.
Type Parameters
TThe sequence element type.
EncodeSequence<T>(ref IceEncoder, IEnumerable<T>, EncodeAction<T>)
Encodes a sequence.
public static void EncodeSequence<T>(this ref IceEncoder encoder, IEnumerable<T> v, EncodeAction<T> encodeAction)
Parameters
encoderIceEncoderThe Ice encoder.
vIEnumerable<T>The sequence to encode.
encodeActionEncodeAction<T>The encode action for an element.
Type Parameters
TThe type of the sequence elements. It is non-nullable except for class and proxy types.
EncodeSpan<T>(ref IceEncoder, ReadOnlySpan<T>)
Encodes a span of fixed-size numeric values, such as int or ulong.
public static void EncodeSpan<T>(this ref IceEncoder encoder, ReadOnlySpan<T> v) where T : struct
Parameters
encoderIceEncoderThe Ice encoder.
vReadOnlySpan<T>The span of numeric values represented by a ReadOnlySpan<T>.
Type Parameters
TThe span element type.
WriteByteSequence(ref IceEncoder, ReadOnlySequence<byte>)
Copies a sequence of bytes to the underlying buffer writer.
public static void WriteByteSequence(this ref IceEncoder encoder, ReadOnlySequence<byte> v)
Parameters
encoderIceEncoderThe Ice encoder.
vReadOnlySequence<byte>The sequence to copy.