         }
     }
     
-    public func encode<T: Codable>(_ value: T) -> Result<Data, Error> {
+    public func encode<T>(_ value: T) -> Result<Data, Error> where T: Encodable {
         do {
             let encoded = try encoder.encode(value)
             return .success(encoded)

        self.decoder = JSONDecoder()
    }
    
    public func decode<T: Codable>(data: Data) -> Result<T, Error> {
        do {
            let decoded = try decoder.decode(T.self, from: data)
            return .success(decoded)


public protocol Serializer {
    
    func decode<T>(data: Data) -> Result<T, Error> where T: Decodable
    
    func encode<T>(_ value: T) -> Result<Data, Error> where T: Encodable
    
}

