Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.

Enumeration_Case

mattt edited this page Feb 7, 2020 · 6 revisions

Enumeration.Case

An enumeration case.

public struct Case: Declaration, Hashable, Codable

Inheritance

Codable, Hashable, Declaration

Initializers

init(_:)

Creates an instance initialized with the given syntax node.

public init(_ node: EnumDeclSyntax)

init?(element:)

private init?(element node: EnumCaseElementSyntax)

init(_:)

Creates an instance initialized with the given syntax node.

@available(swift, introduced: 0.0.1, deprecated: 0.0.1, message: "Use Enumeration.Case.cases(from:) instead") public init(_ node: EnumCaseDeclSyntax)

Properties

associatedValue

The associated values of the enumeration case, if any.

let associatedValue: [Function.Parameter]?

modifiers

The declaration modifiers.

let modifiers: [Modifier]

name

The enumeration case name.

let name: String

description

var description: String

description

var description: String

keyword

The declaration keyword ("case").

let keyword: String

rawValue

The raw value of the enumeration case, if any.

let rawValue: String?

attributes

The declaration attributes.

let attributes: [Attribute]

context

A dot-delimited (.) path used to qualify the enumeration case name within the module scope of the declaration, or nil if the containing enumeration isn't nested (that is, declared at the top-level scope of a module).

let context: String?

For example, given the following declaration of case C.c the context is "A.B":

enum A { enum B { enum C { case c } }

Methods

cases(from:)

Creates and returns enumeration cases from an enumeration case declaration.

public static func cases(from node: EnumCaseDeclSyntax) -> [Enumeration.Case]

Clone this wiki locally