Structure
Enumeration.Case
public struct Case: Declaration, Hashable, Codable
An enumeration case.
Relationships
Member Of
Enumeration
An enumeration declaration.
Conforms To
Declaration
A Swift declaration.
Codable
CustomStringConvertible
Hashable
Initializers
init?(_:)
public init?(_ node: EnumCaseElementSyntax)
Creates an instance initialized with the given syntax node.
Properties
keyword
let keyword: String
The declaration keyword ("case"
).
name
let name: String
The enumeration case name.
associatedValue
let associatedValue: [Function.Parameter]?
The associated values of the enumeration case, if any.
rawValue
let rawValue: String?
The raw value of the enumeration case, if any.
description
var description: String
Methods
cases(from:)
public static func cases(from node: EnumCaseDeclSyntax) -> [Enumeration.Case]
Creates and returns enumeration cases from an enumeration case declaration.