frostfs-sdk-csharp/src/FrostFS.SDK.ClientV2/Models/Object/FrostFsRange.cs
Pavel Gross 003b7fdfdd [#25] Client: Implement Patch and Range methods
Signed-off-by: Pavel Gross <p.gross@yadro.com>
2024-11-08 10:38:50 +03:00

27 lines
723 B
C#

namespace FrostFS.SDK;
public readonly struct FrostFsRange(ulong offset, ulong length) : System.IEquatable<FrostFsRange>
{
public ulong Offset { get; } = offset;
public ulong Length { get; } = length;
public override readonly bool Equals(object obj) => this == (FrostFsRange)obj;
public override readonly int GetHashCode() => $"{Offset}{Length}".GetHashCode();
public static bool operator ==(FrostFsRange left, FrostFsRange right)
{
return left.Equals(right);
}
public static bool operator !=(FrostFsRange left, FrostFsRange right)
{
return !(left == right);
}
public readonly bool Equals(FrostFsRange other)
{
return this == other;
}
}