Fauna v10 .NET/C# Driver
0.2.0-beta
Loading...
Searching...
No Matches
Fauna
Serialization
ISerializer.cs
Go to the documentation of this file.
1
using
Fauna.Mapping
;
2
3
namespace
Fauna.Serialization
;
4
5
public
interface
ISerializer
<out T> :
ISerializer
6
{
7
new
T
Deserialize
(
MappingContext
context, ref
Utf8FaunaReader
reader);
8
}
9
10
public
interface
ISerializer
11
{
12
object
?
Deserialize
(
MappingContext
context, ref
Utf8FaunaReader
reader);
13
void
Serialize
(
MappingContext
ctx,
Utf8FaunaWriter
w,
object
? o);
14
}
15
16
public
abstract
class
BaseSerializer
<T> :
ISerializer
<T>
17
{
18
protected
string
UnexpectedTokenExceptionMessage
(
TokenType
token) => $
"Unexpected token `{token}` deserializing with `{GetType().Name}`"
;
19
20
protected
string
UnsupportedSerializationTypeMessage
(Type type) => $
"Cannot serialize `{type}` with `{GetType()}`"
;
21
22
object
?
ISerializer
.
Deserialize
(
MappingContext
context, ref
Utf8FaunaReader
reader) =>
23
Deserialize(context, ref reader);
24
25
public
abstract
T
Deserialize
(
MappingContext
context, ref
Utf8FaunaReader
reader);
26
27
void
ISerializer
.
Serialize
(
MappingContext
context,
Utf8FaunaWriter
writer,
object
? o) =>
28
Serialize(context, writer, o);
29
30
public
abstract
void
Serialize
(
MappingContext
context,
Utf8FaunaWriter
writer,
object
? o);
31
32
protected
static
SerializationException
UnexpectedToken
(
TokenType
token) =>
33
new
($
"Unexpected token while deserializing: {token}"
);
34
}
Fauna.Mapping.MappingContext
A class representing the mapping context to be used during serialization and deserialization.
Definition
MappingContext.cs:9
Fauna.Serialization.BaseSerializer
Definition
ISerializer.cs:17
Fauna.Serialization.BaseSerializer.UnsupportedSerializationTypeMessage
string UnsupportedSerializationTypeMessage(Type type)
Fauna.Serialization.BaseSerializer.Deserialize
T Deserialize(MappingContext context, ref Utf8FaunaReader reader)
Fauna.Serialization.BaseSerializer.UnexpectedToken
static SerializationException UnexpectedToken(TokenType token)
Fauna.Serialization.BaseSerializer.Serialize
void Serialize(MappingContext context, Utf8FaunaWriter writer, object? o)
Fauna.Serialization.BaseSerializer.UnexpectedTokenExceptionMessage
string UnexpectedTokenExceptionMessage(TokenType token)
Fauna.Serialization.SerializationException
Represents error that occur during serialization and deserialization of Fauna data.
Definition
SerializationException.cs:7
Fauna.Serialization.Utf8FaunaWriter
Provides functionality for writing data in a streaming manner to a buffer or a stream.
Definition
Utf8FaunaWriter.cs:13
Fauna.Serialization.ISerializer
Definition
ISerializer.cs:11
Fauna.Serialization.ISerializer.Deserialize
object? Deserialize(MappingContext context, ref Utf8FaunaReader reader)
Fauna.Serialization.ISerializer.Serialize
void Serialize(MappingContext ctx, Utf8FaunaWriter w, object? o)
Fauna.Serialization.ISerializer.Deserialize
new T Deserialize(MappingContext context, ref Utf8FaunaReader reader)
Fauna.Mapping
Definition
Attributes.cs:1
Fauna.Serialization
Definition
ISerializer.cs:3
Fauna.Serialization.TokenType
TokenType
Enumerates the types of tokens used in Fauna serialization.
Definition
TokenType.cs:7
Fauna.Serialization.Utf8FaunaReader
Represents a reader that provides fast, non-cached, forward-only access to serialized data.
Definition
Utf8FaunaReader.cs:14
Generated by
1.12.0