// Copyright (c) All contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System.Buffers; using System.ComponentModel; namespace MessagePack.Formatters { #pragma warning disable SA1649 // File name should match first type name /// /// A base interface for so that all generic implementations /// can be detected by a common base type. /// [EditorBrowsable(EditorBrowsableState.Never)] public interface IMessagePackFormatter { } #pragma warning restore SA1649 // File name should match first type name /// /// The contract for serialization of some specific type. /// /// The type to be serialized or deserialized. public interface IMessagePackFormatter : IMessagePackFormatter { /// /// Serializes a value. /// /// The writer to use when serializing the value. /// The value to be serialized. /// The serialization settings to use, including the resolver to use to obtain formatters for types that make up the composite type . void Serialize(ref MessagePackWriter writer, T value, MessagePackSerializerOptions options); /// /// Deserializes a value. /// /// The reader to deserialize from. /// The serialization settings to use, including the resolver to use to obtain formatters for types that make up the composite type . /// The deserialized value. T Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options); } }