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

Protocol

Mattt edited this page Aug 2, 2020 · 7 revisions

Protocol

A protocol declaration.

public struct Protocol:​ Declaration, Hashable, Codable

Inheritance

Codable, CustomStringConvertible, Declaration, ExpressibleBySyntax, Hashable

Initializers

init(_:​)

Creates an instance initialized with the given syntax node.

public init(_ node:​ ProtocolDeclSyntax)

Properties

attributes

The declaration attributes.

let attributes:[Attribute]

modifiers

The declaration modifiers.

let modifiers:[Modifier]

keyword

The declaration keyword ("protocol").

let keyword:​ String

name

The protocol name.

let name:​ String

inheritance

A list of adopted protocols.

let inheritance:[String]

For example, given the following declarations, the inheritance of protocol P is ["Q"]:​

protocol Q {}
protocol P:​ Q {}

description

var description:​ String
Clone this wiki locally