elliebot/src/Ellie.Marmalade/ParamParser/ParamParser.cs

17 lines
581 B
C#
Raw Normal View History

2024-03-23 05:42:46 +00:00
namespace Ellie.Canary;
/// <summary>
/// Overridden to implement parsers for custom types
/// </summary>
/// <typeparam name="T">Type into which to parse the input</typeparam>
public abstract class ParamParser<T>
{
/// <summary>
/// Overridden to implement parsing logic
/// </summary>
/// <param name="ctx">Context</param>
/// <param name="input">Input to parse</param>
/// <returns>A <see cref="ParseResult{T}"/> with successful or failed status</returns>
public abstract ValueTask<ParseResult<T>> TryParseAsync(AnyContext ctx, string input);
}