9 private Func<I, O> _mapper;
18 _mapper(_inner.Deserialize(context, ref reader));
22 throw new NotImplementedException();
30 public ProjectionDeserializer(IEnumerable<ISerializer> fields)
32 _fields = fields.ToArray();
37 if (reader.CurrentTokenType !=
TokenType.StartArray)
38 throw UnexpectedToken(reader.CurrentTokenType);
40 var values =
new object?[_fields.Length];
42 for (var i = 0; i < _fields.Length; i++)
45 if (reader.CurrentTokenType ==
TokenType.EndArray)
throw UnexpectedToken(reader.CurrentTokenType);
47 values[i] = _fields[i].
Deserialize(context, ref reader);
51 if (reader.CurrentTokenType !=
TokenType.EndArray)
throw UnexpectedToken(reader.CurrentTokenType);
58 throw new NotImplementedException();
62 new($
"Unexpected token while deserializing LINQ element: {tokenType}");
A class representing the mapping context to be used during serialization and deserialization.
Represents error that occur during serialization and deserialization of Fauna data.
Provides functionality for writing data in a streaming manner to a buffer or a stream.
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.