request/src/request.result/IResultFactory.cs

20 lines
610 B
C#

// Copyright (c) The Geekeey Authors
// SPDX-License-Identifier: EUPL-1.2
using System.Diagnostics.CodeAnalysis;
namespace Geekeey.Request.Result;
/// <summary>
/// An interface for a result.
/// </summary>
[SuppressMessage("Naming", "CA1716:Identifiers should not match keywords")]
public interface IResultFactory<out TSelf> where TSelf : IResultFactory<TSelf>
{
/// <summary>
/// Creates a new result with a failure value.
/// </summary>
/// <param name="error">The error of the result.</param>
/// <returns>A new result with a failure value.</returns>
static abstract TSelf Failure(Error error);
}