<PackageReference Include="System.Memory" Version="4.6.0" />

SequencePosition

Represents position in non-contiguous set of memory. Properties of this type should not be interpreted by anything but the type that created it.
using System.ComponentModel; using System.Numerics.Hashing; namespace System { public readonly struct SequencePosition : IEquatable<SequencePosition> { private readonly object _object; private readonly int _integer; public SequencePosition(object object, int integer) { _object = object; _integer = integer; } [EditorBrowsable(EditorBrowsableState.Never)] public object GetObject() { return _object; } [EditorBrowsable(EditorBrowsableState.Never)] public int GetInteger() { return _integer; } public bool Equals(SequencePosition other) { if (_integer == other._integer) return object.Equals(_object, other._object); return false; } [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) { if (obj is SequencePosition) { SequencePosition other = (SequencePosition)obj; return Equals(other); } return false; } [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() { return HashHelpers.Combine(_object?.GetHashCode() ?? 0, _integer); } } }