1 /** 2 Protocol for type-erased record fields. 3 */ 4 public protocol AnyField { getnull5 func get() -> Any 6 } 7 8 /** 9 Internal-only additions to `AnyField` protocol. 10 */ 11 internal protocol AnyFieldInternal: AnyField { 12 var key: String? { get } 13 var options: Set<FieldOption> { get set } 14 15 /** 16 Whether the value for this field must be explicitly provided. 17 The record throws an error when the source dictionary is missing a required value. 18 Note that it's NOT the opposite to `isOptional`. 19 */ 20 var isRequired: Bool { get } 21 22 func set(_ newValue: Any?, appContext: AppContext) throws 23 } 24