Skip to content

Instance Property

properties

Returns a fully generic list of every property on the given instance of the type which uses any of the FluentKit property wrapper types (e.g. any wrapper conforming to AnyProperty). This accessor is not static because FluentKit depends upon access to the backing storage of the property wrappers, which is specific to each instance.
var properties: [any AnyProperty] { get }

Discussion

Warning

This accessor triggers the use of reflection, which is at the time of this writing the most severe performance bottleneck in FluentKit by a huge margin. Every access of this property carries the same cost; it is not possible to meaningfully cache the results. See MirrorBypass.swift for a considerable amount of very low-level detail.

Default Implementations

Fields Implementations

  • properties
    A passthrough to properties, as invoked on self.model. This is a deliberate shadowing override of properties for the alias type itself, required to allow projected property values (i.e. instances of AliasedField) to correctly behave as the properties they provide automatic access to. Without this override, the “parent” implementation would always return an empty array, as the alias type does not itself make direct use of any of the property wrapper types.
  • properties
    Default implementation of properties.