Skip to content
mattpolzin edited this page Sep 28, 2020 · 5 revisions

Either

Can contain a value of either type A or type B.

public enum Either<A, B>

If it contains a value of type A, then the value can be accessed with the .a property and similarly for type B and the .b property.

A type-erased value can be retrieved with the .value property.

Inheritance

CustomDebugStringConvertible, CustomStringConvertible, Decodable, Encodable, LocallyDereferenceable

Initializers

init(_:)

public init(_ a: A)

init(_:)

public init(_ b: B)

Enumeration Cases

a

case a(: A)

b

case b(: B)

Properties

description

var description: String

debugDescription

var debugDescription: String

a

var a: A?

b

var b: B?

value

var value: Any
Types
Protocols
Global Functions
Extensions
Clone this wiki locally