Class NullableSerializer<T>
- Namespace
- Stride.Core.Serialization.Serializers
- Assembly
- Stride.Core.dll
Data serializer for Nullable{T}.
[DataSerializerGlobal(typeof(NullableSerializer<>), typeof(T?), DataSerializerGenericMode.GenericArguments, false, false)]
public class NullableSerializer<T> : DataSerializer<T?> where T : struct
Type Parameters
T
The generic type in Nullable{T}.
- Inheritance
-
DataSerializer<T?>NullableSerializer<T>
- Inherited Members
Methods
Initialize(SerializerSelector)
Initializes the specified serializer.
public override void Initialize(SerializerSelector serializerSelector)
Parameters
serializerSelector
SerializerSelectorThe serializer.
Remarks
This method should be thread-safe and OK to call multiple times.
Serialize(ref T?, ArchiveMode, SerializationStream)
Serializes or deserializes the given object obj
.
public override void Serialize(ref T? obj, ArchiveMode mode, SerializationStream stream)
Parameters
obj
T?The object to serialize or deserialize.
mode
ArchiveModeThe serialization mode.
stream
SerializationStreamThe stream to serialize or deserialize to.