mirror of
https://github.com/hyperoslo/Cache.git
synced 2026-04-07 19:17:36 +00:00
12 lines
272 B
Swift
12 lines
272 B
Swift
import Foundation
|
|
|
|
public class Transformer<T> {
|
|
let toData: (T) throws -> Data
|
|
let fromData: (Data) throws -> T
|
|
|
|
public init(toData: @escaping (T) throws -> Data, fromData: @escaping (Data) throws -> T) {
|
|
self.toData = toData
|
|
self.fromData = fromData
|
|
}
|
|
}
|