### AllocBase Protocol Definition Source: https://github.com/open-portfolio/allocdata/blob/main/README.md Defines the base functionality for all entities, primarily including a schema identifier. ```swift public protocol AllocBase { static var schema: AllocSchema { get } } ``` -------------------------------- ### AllocAttributable Protocol Definition Source: https://github.com/open-portfolio/allocdata/blob/main/README.md Provides a way to fetch a description of an entity's attributes. This protocol is used for introspection of entity properties. ```swift public protocol AllocAttributable { static var attributes: [AllocAttribute] { get } } ``` -------------------------------- ### AllocKeyed Protocol Definition Source: https://github.com/open-portfolio/allocdata/blob/main/README.md Enables retrieval and generation of an entity's primary key. Replaces older string-based implementations with a struct-based approach. The `emptyKey` property is useful for picker tag values. ```swift public protocol AllocKeyed: Hashable { associatedtype Key: Hashable, Codable var primaryKey: Key { get } static var emptyKey: Key { get } } ``` -------------------------------- ### AllocRowed Protocol Definition Source: https://github.com/open-portfolio/allocdata/blob/main/README.md Facilitates parsing (decoding) and generation (encoding) of delimited data for entities. It includes methods for initializing objects from rows, decoding raw rows, updating entities, and retrieving primary keys. ```swift public protocol AllocRowed: AllocKeyed { // pre-decoded row, without strong typing typealias RawRow = [String: String] // decoded row, with stronger typing typealias DecodedRow = [String: AnyHashable] // create object from row init(from row: DecodedRow) throws static func decode(_ rawRows: [RawRow], rejectedRows: inout [RawRow]) throws -> [DecodedRow] // additive update from row mutating func update(from row: DecodedRow) throws static func getPrimaryKey(_ row: DecodedRow) throws -> Key } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.