public IList <MutateInSpec> GetCommandValues()
        {
            var responseSpan = Data.Span;

            ReadExtras(responseSpan);

            //all mutations successful
            if (responseSpan.Length == OperationHeader.Length + Header.FramingExtrasLength)
            {
                return(MutateCommands.OrderBy(spec => spec.OriginalIndex).ToList());
            }

            if (Header.BodyOffset > responseSpan.Length)
            {
                throw new DecodingFailureException();
            }

            responseSpan = responseSpan.Slice(Header.BodyOffset);

            //some commands return nothing - so return back an empty list
            if (responseSpan.Length == 0)
            {
                return(new List <MutateInSpec>());
            }

            for (;;)
            {
                var index   = responseSpan[0];
                var command = MutateCommands[index];
                command.Status = (ResponseStatus)ByteConverter.ToUInt16(responseSpan.Slice(1));

                //if success read value and loop to next result - otherwise terminate loop here
                if (command.Status == ResponseStatus.Success)
                {
                    var valueLength = ByteConverter.ToInt32(responseSpan.Slice(3));
                    if (valueLength > 0)
                    {
                        var payLoad = new byte[valueLength];
                        responseSpan.Slice(7, valueLength).CopyTo(payLoad);
                        command.Bytes = payLoad;
                    }

                    responseSpan = responseSpan.Slice(7 + valueLength);
                }
                else
                {
                    break;
                }

                if (responseSpan.Length <= 0)
                {
                    break;
                }
            }

            return(MutateCommands.OrderBy(spec => spec.OriginalIndex).ToList());
        }
 public bool Equals(MultiMutation <T>?other)
 {
     if (other == null)
     {
         return(false);
     }
     if (Cas == other.Cas &&
         MutateCommands.Equals(other.MutateCommands) &&
         Key == other.Key)
     {
         return(true);
     }
     return(false);
 }