SwiftSemantics Documentation Beta

Structure Enumeration.​Case

public struct Case: Declaration, Hashable, Codable

An enumeration case.

%3 Enumeration.Case Enumeration.Case CustomStringConvertible CustomStringConvertible Enumeration.Case->CustomStringConvertible Hashable Hashable Enumeration.Case->Hashable Codable Codable Enumeration.Case->Codable Declaration Declaration Enumeration.Case->Declaration

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

attributes

let attributes: [Attribute]

The declaration attributes.

modifiers

let modifiers: [Modifier]

The declaration modifiers.

keyword

let keyword: String

The declaration keyword ("case").

name

let name: String

The enumeration case name.

associated​Value

let associatedValue: [Function.Parameter]?

The associated values of the enumeration case, if any.

raw​Value

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.