Protocol
ParentCodable
public protocol ParentCodable: Codable, ParentCodableDynamicDispatch where ChildCodable: Codable
A type that can wrap a child Codable value into a representation of itself.
Protocol ParentCodable can only be used as a generic constraint because it has
Self or associated type requirements.
Relationships
Conforms To
ParentCodableDynamicDispatchParentCodableDynamicDispatch is a weakly typed wrapper to dispatch wrap method calls to a ParentCodable object.
Codable
Requirements
ChildCodable
associatedtype ChildCodable
The associated child type implementing the Decodable and Encodable protocols.
wrap(child:)
static func wrap(child: ChildCodable) -> Self
Wraps a value of type ChildCodable into a representation of itself.
Parameters
| Name | Type | Description |
|---|---|---|
| child | ChildCodable |
The value to be wrapped by the parent type. |
Returns
An instance of the parent type wrapping the child value.