ContentTransformerWrapper
@MainActor
public struct ContentTransformerWrapper<ContentType> : Sendable where ContentType : ContentTypeable
A type-erased box wrapping any object conforming to ContentTransformable for a specific ContentType.
Action doesn’t know the concrete Request.ResultData type of the Interactor whose assistant it holds. That type only exists at ActionConfiguration‘s generic scope where the Interactor assistant is built. ContentTransformerWrapper bridges that gap: ActionConfiguration wraps a typed ContentTransformable object in the wrapper and Action stores it.
Internally this stores the wrapped transformer inside a generic ConcreteContentTransformerBox, dispatched through the ContentTransformerBox witness table, which lets this type conform to Sendable unconditionally.
-
Wraps the given transformer, erasing its
ResultDatatype.Declaration
Swift
@MainActor public init<Transformer>(_ transformer: Transformer) where ContentType == Transformer.Output, Transformer : ContentTransformableParameters
transformerThe typed transformer to wrap.
View on GitHub