AnyCursor
public final class AnyCursor<Element> : Cursor
A type-erased cursor of Element.
This cursor forwards its next() method to an arbitrary underlying cursor having the same Element type, hiding the specifics of the underlying cursor.
-
Creates a cursor that wraps a base cursor but whose type depends only on the base cursor’s element type
Declaration
Swift
public init<C: Cursor>(_ base: C) where C.Element == Element
-
Creates a cursor that wraps a base iterator but whose type depends only on the base iterator’s element type
Declaration
Swift
public convenience init<I: IteratorProtocol>(iterator: I) where I.Element == Element
-
Creates a cursor that wraps a base sequence but whose type depends only on the base sequence’s element type
Declaration
Swift
public convenience init<S: Sequence>(_ s: S) where S.Element == Element
-
Creates a cursor that wraps the given closure in its next() method
Declaration
Swift
public init(_ body: @escaping () throws -> Element?)