MarkedCircularBuffer

public struct MarkedCircularBuffer<Element> : CustomStringConvertible
extension MarkedCircularBuffer: Collection, MutableCollection
extension MarkedCircularBuffer: RandomAccessCollection

A circular buffer that allows one object at a time to be “marked” and easily identified and retrieved later.

This object is used extensively within SwiftNIO to handle flushable buffers. It can be used to store buffered writes and mark how far through the buffer the user has flushed, and therefore how far through the buffer is safe to write.

  • Create a new instance.

    • paramaters:
      • initialCapacity: The initial capacity of the internal storage.

    Declaration

    Swift

    @inlinable
    public init(initialCapacity: Int)

Forwarding

  • Appends an entry to the buffer, expanding it if needed.

    Declaration

    Swift

    @inlinable
    public mutating func append(_ value: Element)
  • Removes the first element from the buffer.

    Declaration

    Swift

    @inlinable
    public mutating func removeFirst() -> Element
  • Undocumented

    Declaration

    Swift

    @inlinable
    public mutating func popFirst() -> Element?
  • The first element in the buffer.

    Declaration

    Swift

    @inlinable
    public var first: Element? { get }
  • If the buffer is empty.

    Declaration

    Swift

    @inlinable
    public var isEmpty: Bool { get }
  • The number of elements in the buffer.

    Declaration

    Swift

    @inlinable
    public var count: Int { get }
  • Declaration

    Swift

    @inlinable
    public var description: String { get }

Marking