1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-10-04 02:11:11 +00:00
Files
CryptoExchange.Net/CryptoExchange.Net/Objects/Results/ICallResult.cs
T
Jan Korf ae7504c26c Shared API's V2 (#289)
Added V2 Shared API's infrastructure
Added request coalescing
Added rate limiting admission logic
Fixed some rate limiting issues
2026-09-23 09:15:39 +02:00

62 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace CryptoExchange.Net.Objects;
/// <summary>
/// Call result
/// </summary>
public interface ICallResult
{
/// <summary>
/// An error if the call didn't succeed, will always be filled if Success = false
/// </summary>
Error? Error { get; }
/// <summary>
/// Whether the call was successful
/// </summary>
[MemberNotNullWhen(false, nameof(Error))]
bool Success { get; }
}
/// <summary>
/// Call result
/// </summary>
/// <typeparam name="T">Result data type</typeparam>
public interface ICallResult<T> : ICallResult
{
/// <inheritdoc />
new Error? Error { get; }
/// <inheritdoc />
[MemberNotNullWhen(false, nameof(Error))]
[MemberNotNullWhen(true, nameof(Data))]
new bool Success { get; }
/// <summary>
/// The result data, only available when Success = true
/// </summary>
T? Data { get; }
}
/// <summary>
/// Exchange call result
/// </summary>
public interface IExchangeCallResult : ICallResult
{
/// <summary>
/// Exchange name
/// </summary>
public string Exchange { get; }
}
/// <summary>
/// Exchange call result
/// </summary>
/// <typeparam name="T">Result data type</typeparam>
public interface IExchangeCallResult<T> : IExchangeCallResult, ICallResult<T>
{
}