[#58] Observable client cut

Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
Pavel Gross 2025-04-11 15:18:18 +03:00 committed by PavelGrossSpb
parent 5f451c8818
commit c88eea1f82
7 changed files with 328 additions and 56 deletions

View file

@ -0,0 +1,38 @@
using FrostFS.SDK;
namespace FrostFS.SDK.Client;
public readonly struct ObjectPartInfo(long offset, int length, FrostFsObjectId objectId) : System.IEquatable<ObjectPartInfo>
{
public long Offset { get; } = offset;
public int Length { get; } = length;
public FrostFsObjectId ObjectId { get; } = objectId;
public override bool Equals(object obj)
{
if (obj == null || obj is not ObjectPartInfo)
return false;
return Equals((ObjectPartInfo)obj);
}
public override int GetHashCode()
{
return ((int)(Offset >> 32)) ^ (int)Offset ^ Length ^ ObjectId.Value.GetHashCode();
}
public static bool operator ==(ObjectPartInfo left, ObjectPartInfo right)
{
return left.Equals(right);
}
public static bool operator !=(ObjectPartInfo left, ObjectPartInfo right)
{
return !(left == right);
}
public bool Equals(ObjectPartInfo other)
{
return GetHashCode() == other.GetHashCode();
}
}