Skip to content

AnyPattern

kareman edited this page Jul 1, 2020 · 5 revisions

AnyPattern

A type erased wrapper around a pattern. Can be used to store patterns in arrays and non-generic variables.

public struct AnyPattern: Pattern

Inheritance

ExpressibleByStringInterpolation, Pattern

Initializers

init(_:)

public init(_ p: Pattern)

init(_:)

@inlinable public init(_ p: AnyPattern)

init(_:)

public init(_ p: Literal)

init(stringLiteral:)

@inlinable public init(stringLiteral value: String)

init(stringInterpolation:)

@inlinable public init(stringInterpolation: StringInterpolation)

Properties

_instructions

let _instructions: (inout Instructions) throws -> Void

_description

let _description: () -> String

description

var description: String

wrapped

The wrapped pattern. If you know the exact type you can unwrap it again.

let wrapped: Any

Methods

createInstructions(_:)

@inlinable public func createInstructions(_ instructions: inout Instructions) throws

Clone this wiki locally