9 private Func<I, O> _mapper;
18 _mapper(_inner.Deserialize(context, ref reader));
25 public ProjectionDeserializer(IEnumerable<IDeserializer> fields)
27 _fields = fields.ToArray();
32 if (reader.CurrentTokenType !=
TokenType.StartArray)
33 throw UnexpectedToken(reader.CurrentTokenType);
35 var values =
new object?[_fields.Length];
37 for (var i = 0; i < _fields.Length; i++)
40 if (reader.CurrentTokenType ==
TokenType.EndArray)
throw UnexpectedToken(reader.CurrentTokenType);
42 values[i] = _fields[i].
Deserialize(context, ref reader);
46 if (reader.CurrentTokenType !=
TokenType.EndArray)
throw UnexpectedToken(reader.CurrentTokenType);
T Deserialize(MappingContext context, ref Utf8FaunaReader reader)
Represents error that occur during serialization and deserialization of Fauna data.
new T Deserialize(MappingContext context, ref Utf8FaunaReader reader)
TokenType
Enumerates the types of tokens used in Fauna serialization.
Represents a reader that provides fast, non-cached, forward-only access to serialized data.