Skip to content

Structure

Extend

A wrapper around a simple [String: Any] storage dictionary used to implement Extendable.
struct Extend

Overview

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

Note

Extend conforms to Codable, but will yield an empty dictionary. Extensions are used for convenience and should not be encoded or decoded.

Topics

Initializers

Instance Properties

Instance Methods

Subscripts

  • subscript(String) -> Any?
    Allow subscripting by String key. This is a type-erased alternative to the get(_:default:) and set(:to:) methods.

Relationships

Conforms To

  • Swift.Decodable
  • Swift.Encodable
  • Swift.ExpressibleByDictionaryLiteral