Vapor Documentation Beta

Protocol Extendable

public protocol Extendable: class

Types conforming to Extendable can have stored properties added in extension by using the Extend struct.

final cass MyType: Extendable { ... }
extension MyType {
    var foo: Int {
        get { return extend.get(\, default: 0) }
        set { extend.set(\, to: newValue) }
%3 Extendable Extendable class class Extendable->class

Conforms To




var extend: Extend

Arbitrary property storage. See Extend and Extendable.