Structure
Protocol
public struct Protocol: Declaration, Hashable, Codable
A protocol declaration.
Relationships
Conforms To
Declaration
A Swift declaration.
ExpressibleBySyntax
A type that can be initialized with a Swift syntax node.
Codable
CustomStringConvertible
Hashable
Initializers
init(_:)
public init(_ node: ProtocolDeclSyntax)
Creates an instance initialized with the given syntax node.
Properties
keyword
let keyword: String
The declaration keyword ("protocol"
).
name
let name: String
The protocol name.
inheritance
let inheritance: [String]
A list of adopted protocols.
For example,
given the following declarations,
the inheritance
of protocol P
is ["Q"]
:
protocol Q {}
protocol P: Q {}
description
var description: String