SwiftSemantics Documentation Beta

Structure Modifier

public struct Modifier: Hashable, Codable

A declaration modifier.

A declaration may have one or more modifiers to specify access control (private / public / etc.), declare a type member (class / static), or designate its mutability (nonmutating). A declaration modifier may specify an additional detail within enclosing parentheses (()) following its name.

For example, the following property declaration has two modifiers:

public private(set) var title: String
%3 Modifier Modifier Hashable Hashable Modifier->Hashable ExpressibleBySyntax ExpressibleBySyntax Modifier->ExpressibleBySyntax CustomStringConvertible CustomStringConvertible Modifier->CustomStringConvertible Codable Codable Modifier->Codable

Conforms To

ExpressibleBySyntax

A type that can be initialized with a Swift syntax node.

Codable
CustomStringConvertible
Hashable

Initializers

init(_:​)

public init(_ node: DeclModifierSyntax)

Creates an instance initialized with the given syntax node.

Properties

name

let name: String

The declaration modifier name.

detail

let detail: String?

The modifier detail, if any.

description

var description: String