namespace KianaBH.KcpSharp.Base; /// /// The options to use when renting buffers from the pool. /// public readonly struct KcpBufferPoolRentOptions : IEquatable { /// /// The minimum size of the buffer. /// public int Size { get; } /// /// True if the buffer may be passed to the outside of KcpSharp. False if the buffer is only used internally in /// KcpSharp. /// public bool IsOutbound { get; } /// /// Create a with the specified parameters. /// /// The minimum size of the buffer. /// /// True if the buffer may be passed to the outside of KcpSharp. False if the buffer is only used /// internally in KcpSharp. /// public KcpBufferPoolRentOptions(int size, bool isOutbound) { Size = size; IsOutbound = isOutbound; } /// public bool Equals(KcpBufferPoolRentOptions other) { return Size == other.Size && IsOutbound == other.IsOutbound; } /// public override bool Equals(object? obj) { return obj is KcpBufferPoolRentOptions other && Equals(other); } /// public override int GetHashCode() { return HashCode.Combine(Size, IsOutbound); } }