Set

extension Set
  • Creates a set containing the elements of a cursor.

    // Set<String>
    let cursor = try String.fetchCursor(db, ...)
    let strings = try Set(cursor)
    

    Declaration

    Swift

    public init(_ cursor: some Cursor<Element>) throws

    Parameters

    cursor

    A cursor of values to gather into a set.

  • Creates a set containing the elements of a cursor.

    // Set<String>
    let cursor = try String.fetchCursor(db, ...)
    let strings = try Set(cursor, minimumCapacity: 100)
    

    Declaration

    Swift

    public init(_ cursor: some Cursor<Element>, minimumCapacity: Int) throws

    Parameters

    cursor

    A cursor of values to gather into a set.

    minimumCapacity

    The minimum number of elements that the newly created set should be able to store without reallocating its storage buffer.