1 // Copyright 2018-present 650 Industries. All rights reserved. 2 3 /** 4 A protocol that allows custom classes or structs to be used as function arguments. 5 It requires static `convert(from:)` function that knows how to convert incoming 6 value of `Any` type to the type implemented by this protocol. It should throw an error 7 when the value is not recognized, is invalid or doesn't meet type requirements. 8 */ 9 public protocol Convertible: AnyArgument { 10 /** 11 Converts any value to the instance of its class (or struct). 12 Throws an error when given value cannot be converted. 13 */ convertnull14 static func convert(from value: Any?) throws -> Self 15 } 16 17 @available(*, deprecated, renamed: "Convertible") 18 public typealias ConvertibleArgument = Convertible 19