~ruther/NosSmooth

NosSmooth/Packets/NosSmooth.PacketSerializer.Abstractions/IStringConverterRepository.cs -rw-r--r-- 997 bytes
8e5e00cc — František Boháček chore: bump packet versions 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//
//  IStringConverterRepository.cs
//
//  Copyright (c) František Boháček. All rights reserved.
//  Licensed under the MIT license. See LICENSE file in the project root for full license information.

using Remora.Results;

namespace NosSmooth.PacketSerializer.Abstractions;

/// <summary>
/// Repository for <see cref="IStringConverter"/>.
/// </summary>
public interface IStringConverterRepository
{
    /// <summary>
    /// Gets the type converter for the given type.
    /// </summary>
    /// <param name="type">The type to find converter for.</param>
    /// <returns>The type converter or an error.</returns>
    public Result<IStringConverter> GetTypeConverter(Type type);

    /// <summary>
    /// Gets the type converter for the given type.
    /// </summary>
    /// <typeparam name="TParseType">The type to find converter for.</typeparam>
    /// <returns>The type converter or an error.</returns>
    public Result<IStringConverter<TParseType>> GetTypeConverter<TParseType>();
}
Do not follow this link