Class TomlSerializer
- Namespace
- ShapeShift.Toml
- Assembly
- ShapeShift.Toml.dll
A ShapeShift-compatible TOML serializer.
public record TomlSerializer : ShapeShiftSerializer<TomlEncoder, TomlDecoder>, IEquatable<ShapeShiftSerializer<TomlEncoder, TomlDecoder>>, IEquatable<TomlSerializer>
- Inheritance
-
TomlSerializer
- Implements
- Inherited Members
Methods
Deserialize<T>(string)
Deserializes a TOML string to a value.
public T? Deserialize<T>(string toml) where T : IShapeable<T>
Parameters
tomlstringThe TOML string to deserialize.
Returns
- T
The deserialized value.
Type Parameters
TThe type of the value to deserialize to.
Deserialize<T, TProvider>(string)
Deserializes a TOML string to a value using the specified type shape.
public T? Deserialize<T, TProvider>(string toml) where TProvider : IShapeable<T>
Parameters
tomlstringThe TOML string to deserialize.
Returns
- T
The deserialized value.
Type Parameters
TThe type of the value to deserialize to.
TProviderThe type that provides the PolyType shape.
Serialize<T>(in T?)
Serializes a value to a TOML string.
public string Serialize<T>(in T? value) where T : IShapeable<T>
Parameters
valueTThe value to serialize.
Returns
- string
The TOML string representation of the value.
Type Parameters
TThe type of the value to serialize.
Serialize<T, TProvider>(in T?)
Serializes a value to a TOML string using the specified type shape.
public string Serialize<T, TProvider>(in T? value) where TProvider : IShapeable<T>
Parameters
valueTThe value to serialize.
Returns
- string
The TOML string representation of the value.
Type Parameters
TThe type of the value to serialize.
TProviderThe type that provides the PolyType shape.