init(_:)
Deprecations.swift:83This declaration is deprecated: Use a 'CasePathable' case key path, instead
init(_ embed: @escaping (Value) -> Root)
This declaration is deprecated: Use a 'CasePathable' case key path, instead
init(_ embed: @escaping (Value) -> Root)
import CasePathsCore
Case paths bring the power and ergonomics of key paths to enums.
import CasePaths
Case paths bring the power and ergonomics of key paths to enums.
@dynamicMemberLookup struct AnyCasePath<Root, Value>
A type-erased case path that supports embedding a value in a root and attempting to extract a root’s embedded value.
init(unsafe embed: @escaping (Value) -> Root)
Returns a case path for the given embed function.
init(unsafe root: @autoclosure @escaping () -> Root) where Value == ()
Returns a void case path for a case with no associated value.
func appending<AppendedValue>(path: AnyCasePath<Value, AppendedValue>) -> AnyCasePath<Root, AppendedValue>
func modify<Result>(_ root: inout Root, _ body: (inout Value) throws -> Result) throws -> Result
static func `case`(_ embed: @escaping (Value) -> Root) -> AnyCasePath<Root, Value>
Returns a case path that extracts values associated with a given enum case initializer.
var description: String { get }
static func .. <AppendedValue>(lhs: AnyCasePath, rhs: AnyCasePath<Value, AppendedValue>) -> AnyCasePath<Root, AppendedValue>
static func .. <AppendedValue>(lhs: AnyCasePath, rhs: @escaping (AppendedValue) -> Value) -> AnyCasePath<Root, AppendedValue>
static func ~= (pattern: AnyCasePath, value: Root) -> Bool