mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
15 lines
413 B
Swift
15 lines
413 B
Swift
import Foundation
|
|
import Postbox
|
|
|
|
public final class EngineEncoder {
|
|
public static func encode(_ value: Encodable) throws -> Data {
|
|
return try AdaptedPostboxEncoder().encode(value)
|
|
}
|
|
}
|
|
|
|
public final class EngineDecoder {
|
|
public static func decode<T>(_ type: T.Type, from data: Data) throws -> T where T : Decodable {
|
|
return try AdaptedPostboxDecoder().decode(type, from: data)
|
|
}
|
|
}
|