OperationStatus.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. // See the LICENSE file in the project root for more information.
  4. namespace System.Buffers
  5. {
  6. /// <summary>
  7. /// This enum defines the various potential status that can be returned from Span-based operations
  8. /// that support processing of input contained in multiple discontiguous buffers.
  9. /// </summary>
  10. public enum OperationStatus
  11. {
  12. /// <summary>
  13. /// The entire input buffer has been processed and the operation is complete.
  14. /// </summary>
  15. Done,
  16. /// <summary>
  17. /// The input is partially processed, up to what could fit into the destination buffer.
  18. /// The caller can enlarge the destination buffer, slice the buffers appropriately, and retry.
  19. /// </summary>
  20. DestinationTooSmall,
  21. /// <summary>
  22. /// The input is partially processed, up to the last valid chunk of the input that could be consumed.
  23. /// The caller can stitch the remaining unprocessed input with more data, slice the buffers appropriately, and retry.
  24. /// </summary>
  25. NeedMoreData,
  26. /// <summary>
  27. /// The input contained invalid bytes which could not be processed. If the input is partially processed,
  28. /// the destination contains the partial result. This guarantees that no additional data appended to the input
  29. /// will make the invalid sequence valid.
  30. /// </summary>
  31. InvalidData,
  32. }
  33. }