Embeddable
public protocol Embeddable : Decodable, Encodable
A Embeddable
type can be used in a Model
as an embedded type. All types embedded in a Model
as an
embedded(type:)
or embeddedCollection(of:)
must comform to the Embeddable
protocol except for Swift’s Basic
types embedded as a collection. A collection of String can be embedded in the Model
as
embeddedCollection(of: String.self)
without needing to conform to Embeddable.
Warning
Although this haspublic
access, it is intended for internal & codegen use and should not be used
directly by host applications. The behavior of this may change without warning. Though it is not used by host
application making any change to these public
types should be backward compatible, otherwise it will be a
breaking change.
-
A reference to the
ModelSchema
associated with this embedded type.Declaration
Swift
static var schema: ModelSchema { get }
-
defineSchema(name:
Extension methodattributes: define: ) Declaration
Swift
public static func defineSchema(name: String? = nil, attributes: ModelAttribute..., define: (inout ModelSchemaDefinition) -> Void) -> ModelSchema